FlashFire/global.html

28 lines
1.1 KiB
HTML
Raw Normal View History

2010-07-10 17:44:22 -05:00
<!DOCTYPE HTML>
<script>
safari.application.addEventListener("message", handleMessage, false);
2010-11-05 16:59:19 -05:00
var FFWhitelist = safari.extension.settings["whitelist"].split(",");
var FFBlacklist = safari.extension.settings["blacklist"].split(",");
2010-07-10 17:44:22 -05:00
function handleMessage(theEvent) {
if (theEvent.name=="canLoad") {
var message = theEvent.message;
console.log(message);
2010-11-05 16:59:19 -05:00
if (message.name=="getSetting") {
console.log("Get Setting");
theEvent.message = safari.extension.settings[message.setting];
} else if (message.name=="getSetting") {
console.log("Set Setting");
safari.extension.settings[message.setting] = message.data;
2010-07-10 17:44:22 -05:00
}
2010-11-05 16:59:19 -05:00
} else if (theEvent.name=="getPreferences") {
var preferences = {invisible: safari.extension.settings["invisible"], whitelist: FFWhitelist, blacklist: FFBlacklist}
safari.application.activeBrowserWindow.activeTab.page.dispatchMessage("preferences", preferences);
} else if (theEvent.name=="setInvisible") {
safari.extension.settings["invisible"] = theEvent.message;
2010-07-10 17:44:22 -05:00
}
}
safari.application.addEventListener("message", handleMessage, false);
</script>