-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtoggleFlash.html
More file actions
35 lines (33 loc) · 13.7 KB
/
toggleFlash.html
File metadata and controls
35 lines (33 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE HTML>
<meta charset="utf-8"/>
<title>Toggle Flash [0.1.4.2 - 2015-05-31]</title>
<body>
<a href="custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3EShockwave%20Flash%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsSAAALEgHS3X78AAAEG0lEQVQ4EQEQBO/7AQYCAgcqNzcrAQ0NAAD9/QD/AAAA////AP7//wD///8AAP7+AP8AAAD//f0A/vz8AP8BAQEAAAD+/wMDBO3Z2doEEf7+J60tLc0iODj9/fX1AwECAv/9/PwA/v7+AP3+/gD9//8A/fv7APwAAAD+BQUA//39Afbz8/wICAgEoe7uogEUAQEvrP//zysAAPr9AAAEAwAA/gAAAAABAAAA/wAAAP8AAAD/AAAA/wAAAPsAAAD9AAABAQAAAPwAAP4HCAgEBAD//wACEREBAAcHBP7//wMBAAAC/gAAAAABAQD//f0A/wQEAP709AD6ExMABmBgAAUJCQH1iooAAAQE/+j19fkE/wEBAPX19QD2+Pj/+wAAAAMAAP/+AAAAAP7+AP8FBQD/9PQA/zU1ABioqAANIiIA99XVAO1+fgAABAT+Af39BwT///8A+gMDAPgEBAD7AAAAAwAAAP7//wD/BAQAAf//APwUFAAgoKAADSIiAO2goADql5cA+QYGAP7+/gD5AQL9BP8AAAD5//8A+P//APsAAAADAQEA/fz8AAIKCgD67u4AEWJiAA4qKgDmqKgA2mFhAAUFBQD/BAQA/wICAPoBAAEC/wAAAPn//wD4//8A+P//APf+/gD3//8A9vn5APgKCgASXl4A/AAAAAo9PQAgsbEA+QkJAPgBAQD3/v4A+P7+AAL/AAAA+AAAAPgAAAD4AQEA9/z8APsNDQD19fUABTw8AA0zMwD35+cACRUVAAoVFQD19fUA+QMDAPgAAAD4AAAABP8AAAD5//8A+AAAAPr+/gACAgIA//PzAPkAAAAhZGQAAwAAANqGhgDjmpoAAxISAPkEBAAA/f0A/gAAAPv//wAE/wAAAPkAAAD4/v4A+/7+AAIFBQD+FRUAG2NjABtVVQDrz88A3KCgAP4BAQD/8PAA/wEBAP///wD+AAAA+///AAQAAAAA+f//APcAAAD7AQEAAwQEAD/DwwAUHh4A8eLiAMpqagD09PQABA0NAPz6+gAAAgIA/v//AP4AAAD8AAAABP4AAP/4//8A+gAAAfr//wAE/v4C7Lu7/+Tp6QDam5sA9OLiAAIKCgD7+PgA/wMDAP///wH+//8A/wAAAfv//wEBDAAAMGsFBc4eAwP3/AAABAEAAP77+fkA/f//AAMFBQACBQUA/fz8AAACAgD+//8A/wAAAf8AAAD/AAD++///AAT3AADx8v7+9AIBAQ39AAD/BAAAAQMKCv8EAwMA/fr6AP36+gAAAwMA/v7+AP8AAAD/AAAB////AP8AAP7+//8BAQAAAAAQAAA9EwEBLfwAAPcBAAAE/////v8AAAEBAAAAAAEBAAAAAAAAAAAAAAAAAP8AAAAAAQEA//7+AAMFBf4vfJFOc0dtUAAAAABJRU5ErkJggg%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20http%3A//infocatcher.ucoz.net/js/cb/toggleFlash.js%0A//%20https%3A//github.com/Infocatcher/Custom_Buttons/tree/master/Toggle_Flash%0A%0A//%20Toggle%20Flash%20button%20for%20Custom%20Buttons%0A//%20%28code%20for%20%22initialization%22%20section%29%0A%0A//%20%28c%29%20Infocatcher%202012-2015%0A//%20version%200.1.4.2%20-%202015-05-31%0A%0Avar%20options%20%3D%20%7B%0A%09pluginName%3A%20%22Shockwave%20Flash%22%2C%20//%20Or%20name%20of%20any%20other%20plugin%0A%09searchInTypes%3A%20%5B%22plugin%22%5D%2C%20//%20Use%20%22extension%22%20to%20toggle%20restartless%20extensions%0A%09//%20Button%20styles%2C%20possible%20values%3A%0A%09//%20checked%3A%20%20%20%20%20%20%20%5Btrue%7Cfalse%5D%0A%09//%20style%3A%20%20%20%20%20%20%20%20%20%22any%20valid%20CSS%22%0A%09//%20iconStyle%3A%20%20%20%20%20%22any%20valid%20CSS%22%0A%09//%20iconGrayscale%3A%20%5Btrue%7Cfalse%5D%0A%09//%20iconOpacity%3A%20%20%200..1%0A%09styleEnabled%3A%20%7B%0A%09%09checked%3A%20false%2C%0A%09%09style%3A%20%22%22%2C%0A%09%09iconStyle%3A%20%22%22%2C%0A%09%09iconGrayscale%3A%20false%2C%0A%09%09iconOpacity%3A%201%2C%0A%09%7D%2C%0A%09styleClickToPlay%3A%20%7B%0A%09%09checked%3A%20false%2C%0A%09%09style%3A%20%22%22%2C%0A%09%09iconStyle%3A%20%22%22%2C%0A%09%09iconGrayscale%3A%20false%2C%0A%09%09iconOpacity%3A%200.65%0A%09%7D%2C%0A%09styleDisabled%3A%20%7B%0A%09%09checked%3A%20false%2C%0A%09%09style%3A%20%22%22%2C%0A%09%09iconStyle%3A%20%22%22%2C%0A%09%09iconGrayscale%3A%20true%2C%0A%09%09iconOpacity%3A%200.65%0A%09%7D%0A%7D%3B%0A%0Afunction%20_localize%28s%2C%20key%29%20%7B%0A%09var%20strings%20%3D%20%7B%0A%09%09%22%25N%3A%20%25S%22%3A%20%7B%20//%20Example%3A%20%22Some%20plugin%3A%20Enabled%22%0A%09%09%09ru%3A%20%22%25N%3A%20%25S%22%0A%09%09%7D%2C%0A%09%09%22Enabled%22%3A%20%7B%0A%09%09%09ru%3A%20%22%u0412%u043A%u043B%u044E%u0447%u0435%u043D%u043E%22%0A%09%09%7D%2C%0A%09%09%22Disabled%22%3A%20%7B%0A%09%09%09ru%3A%20%22%u0412%u044B%u043A%u043B%u044E%u0447%u0435%u043D%u043E%22%0A%09%09%7D%2C%0A%09%09%22Ask%20to%20activate%22%3A%20%7B%0A%09%09%09ru%3A%20%22%u0412%u043A%u043B%u044E%u0447%u0430%u0442%u044C%20%u043F%u043E%20%u0437%u0430%u043F%u0440%u043E%u0441%u0443%22%0A%09%09%7D%2C%0A%09%09%22Not%20installed%22%3A%20%7B%0A%09%09%09ru%3A%20%22%u041D%u0435%20%u0443%u0441%u0442%u0430%u043D%u043E%u0432%u043B%u0435%u043D%u043E%22%0A%09%09%7D%0A%09%7D%3B%0A%09var%20locale%20%3D%20%28function%28%29%20%7B%0A%09%09var%20prefs%20%3D%20Services.prefs%3B%0A%09%09if%28%21prefs.getBoolPref%28%22intl.locale.matchOS%22%29%29%20%7B%0A%09%09%09var%20locale%20%3D%20prefs.getCharPref%28%22general.useragent.locale%22%29%3B%0A%09%09%09if%28locale.substr%280%2C%209%29%20%21%3D%20%22chrome%3A//%22%29%0A%09%09%09%09return%20locale%3B%0A%09%09%7D%0A%09%09return%20Components.classes%5B%22@mozilla.org/chrome/chrome-registry%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIXULChromeRegistry%29%0A%09%09%09.getSelectedLocale%28%22global%22%29%3B%0A%09%7D%29%28%29.match%28/%5E%5Ba-z%5D*/%29%5B0%5D%3B%0A%09_localize%20%3D%20%21locale%20%7C%7C%20locale%20%3D%3D%20%22en%22%0A%09%09%3F%20function%28s%29%20%7B%0A%09%09%09return%20s%3B%0A%09%09%7D%0A%09%09%3A%20function%28s%29%20%7B%0A%09%09%09return%20strings%5Bs%5D%20%26%26%20strings%5Bs%5D%5Blocale%5D%20%7C%7C%20s%3B%0A%09%09%7D%3B%0A%09return%20_localize.apply%28this%2C%20arguments%29%3B%0A%7D%0A%0Avar%20_addon%2C%20_addonId%3B%0Athis._pluginDisabled%20%3D%20undefined%3B%0Avar%20stateNotInstalled%20%3D%20%22notInstalled%22%3B%0Athis.__defineGetter__%28%22pluginDisabled%22%2C%20function%28%29%20%7B%0A%09return%20this._pluginDisabled%3B%0A%7D%29%3B%0Athis.__defineSetter__%28%22pluginDisabled%22%2C%20function%28dis%29%20%7B%0A%09if%28this._pluginDisabled%20%3D%3D%20dis%29%0A%09%09return%3B%0A%09this._pluginDisabled%20%3D%20dis%3B%0A%0A%09var%20style%3B%0A%09var%20state%3B%0A%09if%28%22STATE_ASK_TO_ACTIVATE%22%20in%20AddonManager%20%26%26%20dis%20%3D%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%29%20%7B%0A%09%09style%20%3D%20options.styleClickToPlay%3B%0A%09%09state%20%3D%20_localize%28%22Ask%20to%20activate%22%29%3B%0A%09%7D%0A%09else%20if%28%21dis%29%20%7B%0A%09%09style%20%3D%20options.styleEnabled%3B%0A%09%09state%20%3D%20_localize%28%22Enabled%22%29%3B%0A%09%7D%0A%09else%20if%28dis%20%3D%3D%20stateNotInstalled%29%20%7B%0A%09%09style%20%3D%20options.styleDisabled%3B%0A%09%09state%20%3D%20_localize%28%22Not%20installed%22%29%3B%0A%09%7D%0A%09else%20%7B%0A%09%09style%20%3D%20options.styleDisabled%3B%0A%09%09state%20%3D%20_localize%28%22Disabled%22%29%3B%0A%09%7D%0A%0A%09if%28style.hasOwnProperty%28%22checked%22%29%29%0A%09%09this.checked%20%3D%20style.checked%3B%0A%09if%28style.hasOwnProperty%28%22style%22%29%29%0A%09%09this.style.cssText%20%3D%20style.style%3B%0A%09if%28%0A%09%09style.hasOwnProperty%28%22iconStyle%22%29%0A%09%09%7C%7C%20style.hasOwnProperty%28%22iconGrayscale%22%29%0A%09%09%7C%7C%20style.hasOwnProperty%28%22iconOpacity%22%29%0A%09%29%20%7B%0A%09%09var%20icon%20%3D%20this.ownerDocument.getAnonymousElementByAttribute%28this%2C%20%22class%22%2C%20%22toolbarbutton-icon%22%29%3B%0A%09%09if%28icon%29%20%7B%0A%09%09%09if%28style.hasOwnProperty%28%22iconStyle%22%29%29%0A%09%09%09%09icon.style.cssText%20%3D%20style.iconStyle%3B%0A%09%09%09if%28style.hasOwnProperty%28%22iconGrayscale%22%29%29%20%7B%0A%09%09%09%09icon.style.filter%20%3D%20style.iconGrayscale%0A%09%09%09%09%09%3F%20parseFloat%28Services.appinfo.platformVersion%29%20%3E%3D%2036%0A%09%09%09%09%09%09%3F%20%22grayscale%281%29%22%0A%09%09%09%09%09%09%3A%20%27url%28%22chrome%3A//mozapps/skin/extensions/extensions.svg%23greyscale%22%29%27%0A%09%09%09%09%09%3A%20%22%22%3B%0A%09%09%09%7D%0A%09%09%09if%28style.hasOwnProperty%28%22iconOpacity%22%29%29%0A%09%09%09%09icon.style.opacity%20%3D%20style.iconOpacity%3B%0A%09%09%7D%0A%09%7D%0A%0A%09this.tooltipText%20%3D%20_localize%28%22%25N%3A%20%25S%22%29%0A%09%09.replace%28%22%25N%22%2C%20options.pluginName%29%0A%09%09.replace%28%22%25S%22%2C%20state%29%3B%0A%7D%29%3B%0Aif%28%21%28%22AddonManager%22%20in%20window%29%29%0A%09Components.utils.import%28%22resource%3A//gre/modules/AddonManager.jsm%22%29%3B%0A%0Athis.initAddonListener%20%3D%20function%28%29%20%7B%0A%09var%20addonListener%20%3D%20%7B%0A%09%09button%3A%20this%2C%0A%09%09onEnabled%3A%20function%28addon%29%20%7B%0A%09%09%09this._updateButton%28addon%29%3B%0A%09%09%7D%2C%0A%09%09onDisabled%3A%20function%28addon%29%20%7B%0A%09%09%09this._updateButton%28addon%29%3B%0A%09%09%7D%2C%0A%09%09onInstalled%3A%20function%28addon%29%20%7B%0A%09%09%09if%28%0A%09%09%09%09%21_addon%0A%09%09%09%09%26%26%20options.searchInTypes.indexOf%28addon.type%29%20%21%3D%20-1%0A%09%09%09%09%26%26%20addon.name.indexOf%28options.pluginName%29%20%21%3D%20-1%0A%09%09%09%29%20%7B%0A%09%09%09%09_addon%20%3D%20addon%3B%0A%09%09%09%09_addonId%20%3D%20addon.id%3B%0A%09%09%09%09this.button.pluginDisabled%20%3D%20addon.userDisabled%3B%0A%09%09%09%7D%0A%09%09%7D%2C%0A%09%09onUninstalled%3A%20function%28addon%29%20%7B%0A%09%09%09if%28_addon%20%26%26%20addon.id%20%3D%3D%20_addonId%29%20%7B%0A%09%09%09%09_addon%20%3D%20_addonId%20%3D%20undefined%3B%0A%09%09%09%09this.button.pluginDisabled%20%3D%20stateNotInstalled%3B%0A%09%09%09%7D%0A%09%09%7D%2C%0A%09%09onPropertyChanged%3A%20function%28addon%2C%20properties%29%20%7B%0A%09%09%09if%28properties%20%26%26%20properties.indexOf%28%22userDisabled%22%29%20%21%3D%20-1%29%0A%09%09%09%09this._updateButton%28addon%29%3B%0A%09%09%7D%2C%0A%09%09_updateButton%3A%20function%28addon%29%20%7B%0A%09%09%09if%28addon.id%20%3D%3D%20_addonId%29%0A%09%09%09%09this.button.pluginDisabled%20%3D%20addon.userDisabled%3B%0A%09%09%7D%0A%09%7D%3B%0A%09AddonManager.addAddonListener%28addonListener%29%3B%0A%09this.onDestroy%20%3D%20function%28%29%20%7B%0A%09%09AddonManager.removeAddonListener%28addonListener%29%3B%0A%09%7D%3B%0A%7D%3B%0A%0Avar%20btn%20%3D%20this%3B%0AAddonManager.getAddonsByTypes%28options.searchInTypes%2C%20function%28addons%29%20%7B%0A%09addons.some%28function%28addon%29%20%7B%0A%09%09if%28addon.name.indexOf%28options.pluginName%29%20%3D%3D%20-1%29%0A%09%09%09return%20false%3B%0A%09%09_addon%20%3D%20addon%3B%0A%09%09_addonId%20%3D%20addon.id%3B%0A%09%09btn.pluginDisabled%20%3D%20addon.userDisabled%3B%0A%09%09return%20true%3B%0A%09%7D%29%3B%0A%09if%28%21_addon%29%0A%09%09btn.pluginDisabled%20%3D%20stateNotInstalled%3B%0A%09btn.initAddonListener%28%29%3B%0A%7D%29%3B%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%0A%09if%28e.button%20%21%3D%200%29%0A%09%09return%3B%0A%09if%28%21_addon%29%20%7B%0A%09%09Services.prompt.alert%28window%2C%20this.label%2C%20options.pluginName%20+%20%22%20not%20installed%21%22%29%3B%0A%09%09return%3B%0A%09%7D%0A%09//%20Note%3A%20we%20manually%20updates%20styles%20because%20this%20is%20a%20bit%20faster%2C%20than%20callback%20in%20case%20of%20addon%20changes%0A%09this.pluginDisabled%20%3D%20setNewDisabled%28_addon%29%3B%0A%7D%3B%0Afunction%20setNewDisabled%28addon%29%20%7B%0A%09var%20newDis%20%3D%20getNewDisabled%28addon%29%3B%0A%09var%20oldDis%20%3D%20addon.userDisabled%3B%0A%09addon.userDisabled%20%3D%20newDis%3B%0A%09var%20realDis%20%3D%20addon.userDisabled%3B%0A%09if%28realDis%20%21%3D%20newDis%29%20%7B%20//%20We%20can%27t%20enable%20vulnerable%20plugins%0A%09%09var%20err%20%3D%20%22Can%27t%20set%20addon.userDisabled%20to%20%22%20+%20newDis%20+%20%22%2C%20real%20value%3A%20%22%20+%20realDis%3B%0A%09%09if%28newDis%29%0A%09%09%09Components.utils.reportError%28err%29%3B%0A%09%09else%20%7B%0A%09%09%09LOG%28err%20+%20%22%5CnVulnerable%20plugin%3F%22%29%3B%0A%09%09%09if%28oldDis%20%3D%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%29%0A%09%09%09%09newDis%20%3D%20true%3B%0A%09%09%09else%0A%09%09%09%09newDis%20%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%3B%0A%09%09%09addon.userDisabled%20%3D%20newDis%3B%0A%09%09%7D%0A%09%7D%0A%09return%20addon.userDisabled%3B%0A%7D%0Afunction%20getNewDisabled%28addon%29%20%7B%0A%09//%20disabled%20-%3E%20STATE_ASK_TO_ACTIVATE%20-%3E%20enabled%20-%3E%20...%0A%09var%20curDis%20%3D%20addon.userDisabled%3B%0A%09var%20newDis%3B%0A%09if%28%22STATE_ASK_TO_ACTIVATE%22%20in%20AddonManager%20%26%26%20curDis%20%3D%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%29%0A%09%09newDis%20%3D%20false%3B%0A%09else%20if%28%21curDis%29%0A%09%09newDis%20%3D%20true%3B%0A%09else%20%7B%0A%09%09if%28isAskToActivateAddon%28addon%29%29%0A%09%09%09newDis%20%3D%20AddonManager.STATE_ASK_TO_ACTIVATE%3B%0A%09%09else%0A%09%09%09newDis%20%3D%20false%3B%0A%09%7D%0A%09return%20newDis%3B%0A%7D%0Afunction%20isAskToActivateAddon%28addon%29%20%7B%0A%09return%20addon.type%20%3D%3D%20%22plugin%22%0A%09%09%26%26%20%22STATE_ASK_TO_ACTIVATE%22%20in%20AddonManager%0A%09%09%26%26%20Services.prefs.getBoolPref%28%22plugins.click_to_play%22%29%3B%0A%7D%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5Bif%28%21event.target%29%20//%20Button%27s%20hotkey%20pressed%0A%09this.click%28%29%3B%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E"
>Install</a>
| <a href="https://github.com/Infocatcher/Custom_Buttons/tree/master/Toggle_Flash">Source</a>
| <a href="https://github.com/Infocatcher/Custom_Buttons#usage">Instructions</a>
<script type="text/javascript">
var a = document.getElementsByTagName("a")[0];
a.title = document.title;
if(/%3Cimage%3E%3C%21%5BCDATA%5B(data%3A\S+)%5D%5D%3E%3C\/image%3E/.test(a.href)) {
var icon = decodeURIComponent(RegExp.$1);
var img = document.createElement("img");
img.src = icon;
img.alt = "";
img.style.verticalAlign = "middle";
img.style.marginRight = "4px";
img.style.border = "none";
a.insertBefore(img, a.firstChild);
var link = document.createElement("link");
link.rel = "shortcut icon";
link.href = icon;
document.documentElement.insertBefore(link, document.documentElement.firstChild);
}
</script>
<script type="text/javascript" src="https://infocatcher.github.io/Custom_Buttons/viewCustomButton.js"></script>
<script type="text/javascript">
if("viewCustomButtonCode" in window) setTimeout(function() {
viewCustomButtonCode(a.href);
}, 0);
</script>
</body>