Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

89 lines (80 sloc) 2.017 kB
<!doctype html>
<html lang="pt-br">
<head>
<title>QueryDOM</title>
<meta content="utf-8">
<style>
*{
font: 13px Arial;
color: #4E4E4E;
}
fieldset{
width: 348px;
padding: 5px;
border: 1px solid #AEAEAE;
-webkit-border-radius: 4px;
border-radius: 4px;
}
input[type="text"]{
float: left;
width: 300px;
height: 15px;
border: 1px solid #CCC;
padding: 2px;
margin-right: 2px;
background: -webkit-gradient(linear, left bottom, left top, from(#F0F0F0), to(#FFF));
}
input[type="text"]:focus{
border: 1px solid #000;
-webkit-box-shadow: 0 0 4px #AEAEAE;
box-shadow: 0 0 4px #AEAEAE;
}
button[type="button"]{
float: left;
width: 40px;
height: 21px;
background: -webkit-gradient(linear, right bottom, right top, from(#F0F0F0), to(#FFF));
border: 1px solid #CCC;
-webkit-border-radius: 4px;
border-radius: 4px;
}
</style>
</head>
<body>
<fieldset>
<input type="text" id="inp-text" placeholder="Insert a Query">
<button type="button" id="btn-ok">Ok</button>
</fieldset>
<script>
(function(){
var button = document.getElementById('btn-ok');
var text = document.getElementById('inp-text');
text.addEventListener('change', function(){
action();
}, false);
button.addEventListener('click', function(){
action();
}, false);
var action = function(){
var query = text.value;
queryDOM(query);
};
var queryDOM = function(query){
chrome.tabs.executeScript(
null,
{
file: 'media/js/jquery_1.5.2.js',
},
function(){
chrome.tabs.insertCSS(null, { code: '.chrome-queryDOM{ outline: 1px dashed red !important; }' });
chrome.tabs.executeScript(
null,
{ code: '$(".chrome-queryDOM").removeClass("chrome-queryDOM"); $("' + query + '").addClass("chrome-queryDOM")' }
)
}
);
};
})();
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.