mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 06:18:35 +02:00
Fix beastify code (#505)
* Fix blank page bug when clicking popup background
This commit is contained in:
@@ -65,6 +65,10 @@ function listenForClicks() {
|
||||
* Get the active tab,
|
||||
* then call "beastify()" or "reset()" as appropriate.
|
||||
*/
|
||||
if (e.target.tagName !== "BUTTON" || !e.target.closest("#popup-content")) {
|
||||
// Ignore when click is not on a button within <div id="popup-content">.
|
||||
return;
|
||||
}
|
||||
if (e.target.type === "reset") {
|
||||
browser.tabs.query({active: true, currentWindow: true})
|
||||
.then(reset)
|
||||
|
||||
Reference in New Issue
Block a user