Skip to content

Instantly share code, notes, and snippets.

@fedmich
Created April 27, 2012 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedmich/2507187 to your computer and use it in GitHub Desktop.
Save fedmich/2507187 to your computer and use it in GitHub Desktop.
Chrome Extensions
chrome.tabs.executeScript(null,
{code:"document.body.bgColor='red'"});
var url_js = '//example.com/js/script.js';
chrome.tabs.executeScript(null,
{
code:"var scrp = document.createElement('script'); scrp.src = '" + url_js + "?r='+(Math.random()*99999999); scrp.addEventListener('load', function() { }); document.head.appendChild(scrp);"
});
var msg = 'Page succesfully scanned!';
var obj = webkitNotifications.createNotification("http://i.imgur.com/5DgHw.jpg",msg,"");
obj.show();
setTimeout( function(){ obj.cancel(); } , 1550 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment