Commit a8da1f14 authored by Craig Earley's avatar Craig Earley
Browse files

displays alert on any new page load

parent b1f97a46
chrome.tabs.onUpdated.addListener(function (tabID, changeInfo, tab) {
if (changeInfo.status=='complete'){
chrome.tabs.sendMessage(tab.id, { action: 'saySomething' });
}
});
var stop_url = "https://www.google.com/";
chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) {
var url = tabs[0].url;
if (url == stop_url){
document.writeln("welcome to the stop url!");
}
else {document.writeln("not there yet, keep going");}
/*chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) {
var url = tabs[0].url;
if (url == stop_url){
document.writeln("welcome to the stop url!");
}
else {document.writeln("not there yet, keep going");}
});
*/
chrome.runtime.onMessage.addListener(function (msg) {
/* We received a message, let's do as instructed */
if (msg.action == 'saySomething') {
window.alert('something');
}
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment