Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
923 let window = UI.currentWindow; | 923 let window = UI.currentWindow; |
924 if (!window) | 924 if (!window) |
925 return | 925 return |
926 | 926 |
927 let browser = exports.addTab(window, "about:addons").browser; | 927 let browser = exports.addTab(window, "about:addons").browser; |
928 browser.addEventListener("load", function openAddonPrefs(event) | 928 browser.addEventListener("load", function openAddonPrefs(event) |
929 { | 929 { |
930 browser.removeEventListener("load", openAddonPrefs, true); | 930 browser.removeEventListener("load", openAddonPrefs, true); |
931 Utils.runAsync(function() | 931 Utils.runAsync(function() |
932 { | 932 { |
933 // The page won't be ready until the add-on manager data is loaded so we call this method | |
934 // to know when the data will be ready. | |
933 AddonManager.getAddonsByTypes(["extension", "theme", "locale"], functi on() | 935 AddonManager.getAddonsByTypes(["extension", "theme", "locale"], functi on() |
Wladimir Palant
2014/05/08 13:38:00
Please add a comment on why we are doing this. E.g
saroyanm
2014/05/08 14:42:11
Done.
| |
934 { | 936 { |
935 let {addonID} = require("info"); | 937 let event = new Event("Event"); |
936 let addonItem = browser._contentWindow.document.querySelector("#addo ns-list div[addonID='" + addonID + "']"); | 938 event.initEvent("popstate", true, false); |
937 if (addonItem) | 939 event.state = {id: require("info").addonID}; |
938 { | 940 browser._contentWindow.dispatchEvent(event); |
939 let event = new Event("Event"); | |
940 event.initEvent("popstate", true, false); | |
941 event.state = {id: addonID}; | |
942 browser._contentWindow.dispatchEvent(event); | |
943 } | |
944 }); | 941 }); |
945 }); | 942 }); |
946 }, true); | 943 }, true); |
947 }; | 944 }; |
948 | 945 |
949 break; | 946 break; |
950 } | 947 } |
951 } | 948 } |
LEFT | RIGHT |