OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 { | 96 { |
97 window.clearTimeout(activateClickHide.timeout); | 97 window.clearTimeout(activateClickHide.timeout); |
98 activateClickHide.timeout = null; | 98 activateClickHide.timeout = null; |
99 } | 99 } |
100 document.body.classList.remove("clickhide-active"); | 100 document.body.classList.remove("clickhide-active"); |
101 browser.tabs.sendMessage(tab.id, {type: "composer.content.finished"}); | 101 browser.tabs.sendMessage(tab.id, {type: "composer.content.finished"}); |
102 } | 102 } |
103 | 103 |
104 function reportIssue() | 104 function reportIssue() |
105 { | 105 { |
| 106 // do not make the new tab active right away, |
| 107 // let the issue reporter take the screenshot |
| 108 // and handle it so don't window.close() neither |
| 109 // or the screenshot for the active tab might fail |
106 browser.tabs.create({ | 110 browser.tabs.create({ |
| 111 active: false, |
107 url: browser.runtime.getURL("/issue-reporter.html?" + tab.id) | 112 url: browser.runtime.getURL("/issue-reporter.html?" + tab.id) |
108 }).then(() => | |
109 { | |
110 window.close(); | |
111 }); | 113 }); |
112 } | 114 } |
113 | 115 |
114 function toggleCollapse(event) | 116 function toggleCollapse(event) |
115 { | 117 { |
116 let collapser = event.currentTarget; | 118 let collapser = event.currentTarget; |
117 let collapsible = document.getElementById(collapser.dataset.collapsible); | 119 let collapsible = document.getElementById(collapser.dataset.collapsible); |
118 collapsible.classList.toggle("collapsed"); | 120 collapsible.classList.toggle("collapsed"); |
119 togglePref(collapser.dataset.option); | 121 togglePref(collapser.dataset.option); |
120 } | 122 } |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 { | 334 { |
333 if (event.target.id == "notification-optout") | 335 if (event.target.id == "notification-optout") |
334 setPref("notifications_ignoredcategories", true); | 336 setPref("notifications_ignoredcategories", true); |
335 | 337 |
336 notificationElement.hidden = true; | 338 notificationElement.hidden = true; |
337 browser.runtime.sendMessage({type: "notifications.clicked"}); | 339 browser.runtime.sendMessage({type: "notifications.clicked"}); |
338 } | 340 } |
339 }, true); | 341 }, true); |
340 }); | 342 }); |
341 }); | 343 }); |
OLD | NEW |