Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
855 { | 855 { |
856 try | 856 try |
857 { | 857 { |
858 host = location.host.replace(/^www\./, ""); | 858 host = location.host.replace(/^www\./, ""); |
859 } catch (e) {} | 859 } catch (e) {} |
860 } | 860 } |
861 | 861 |
862 if (!host) | 862 if (!host) |
863 return; | 863 return; |
864 | 864 |
865 if (Policy.isWhitelisted(location.spec)) | 865 if (Policy.isWindowWhitelisted(exports.getBrowser(window).contentWindow)) |
Wladimir Palant
2014/08/14 19:58:15
Please revert the changes to this file. Sitekeys s
Thomas Greiner
2014/08/29 15:57:29
Done.
| |
866 UI.removeWhitelist(window); | 866 UI.removeWhitelist(window); |
867 else | 867 else |
868 UI.toggleFilter(Filter.fromText("@@||" + host + "^$document")); | 868 UI.toggleFilter(Filter.fromText("@@||" + host + "^$document")); |
869 }; | 869 }; |
870 | 870 |
871 let menuItem = null; | 871 let menuItem = null; |
872 onShutdown.add(function() | 872 onShutdown.add(function() |
873 { | 873 { |
874 let window = null; | 874 let window = null; |
875 for (window in UI.applicationWindows) | 875 for (window in UI.applicationWindows) |
(...skipping 19 matching lines...) Expand all Loading... | |
895 if (location instanceof Ci.nsIURL && Policy.isBlockableScheme(location)) | 895 if (location instanceof Ci.nsIURL && Policy.isBlockableScheme(location)) |
896 { | 896 { |
897 try | 897 try |
898 { | 898 { |
899 host = location.host.replace(/^www\./, ""); | 899 host = location.host.replace(/^www\./, ""); |
900 } catch (e) {} | 900 } catch (e) {} |
901 } | 901 } |
902 if (!host) | 902 if (!host) |
903 return; | 903 return; |
904 | 904 |
905 if (host && Policy.isWhitelisted(location.spec)) | 905 if (host && Policy.isWindowWhitelisted(exports.getBrowser(window).conten tWindow)) |
906 action = "enable_site"; | 906 action = "enable_site"; |
907 else if (host) | 907 else if (host) |
908 action = "disable_site"; | 908 action = "disable_site"; |
909 } | 909 } |
910 else | 910 else |
911 action = "enable"; | 911 action = "enable"; |
912 | 912 |
913 let actionText = Utils.getString("mobile_menu_" + action); | 913 let actionText = Utils.getString("mobile_menu_" + action); |
914 if (host) | 914 if (host) |
915 actionText = actionText.replace(/\?1\?/g, host); | 915 actionText = actionText.replace(/\?1\?/g, host); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
947 event.state = {id: require("info").addonID}; | 947 event.state = {id: require("info").addonID}; |
948 browser._contentWindow.dispatchEvent(event); | 948 browser._contentWindow.dispatchEvent(event); |
949 }); | 949 }); |
950 }); | 950 }); |
951 }, true); | 951 }, true); |
952 }; | 952 }; |
953 | 953 |
954 break; | 954 break; |
955 } | 955 } |
956 } | 956 } |
OLD | NEW |