Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: composer.js

Issue 29612656: Issue 6053 - Workaround window.close problem on Firefox (Closed)
Patch Set: Created Nov. 20, 2017, 2:53 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: composer.js
diff --git a/composer.js b/composer.js
index 73cbce9f492aad1065f1334f258036194330caf5..94d8a909e50620725ac056d9d153534b6d492954 100644
--- a/composer.js
+++ b/composer.js
@@ -50,6 +50,17 @@ function addFilters()
});
}
+// We'd rather just call window.close, but that isn't working consistently with
+// Firefox 57, even when allowScriptsToClose is passed to browser.windows.create
+// See https://bugzilla.mozilla.org/show_bug.cgi?id=1418394
+function closeMe()
kzar 2017/11/20 14:54:48 Taken straight from adblockplusui/issue-reporter.j
+{
+ browser.runtime.sendMessage({
+ type: "app.get",
+ what: "senderId"
+ }).then(tabId => browser.tabs.remove(tabId));
+}
+
function closeDialog(success)
{
browser.runtime.sendMessage({
@@ -61,7 +72,7 @@ function closeDialog(success)
remove: (typeof success == "boolean" ? success : false)
}
});
- window.close();
+ closeMe();
}
function init()
@@ -88,7 +99,7 @@ function init()
document.getElementById("filters").value = msg.filters.join("\n");
break;
case "composer.dialog.close":
- window.close();
+ closeMe();
break;
}
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld