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

Unified Diff: templates/bootstrap.js.tmpl

Issue 29397581: Issue 5049 - Allow embedded WebExtensions in gecko packager (Closed) Base URL: https://hg.adblockplus.org/buildtools/
Patch Set: Created March 29, 2017, 9:56 a.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 | « packagerGecko.py ('k') | templates/install.rdf.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: templates/bootstrap.js.tmpl
===================================================================
--- a/templates/bootstrap.js.tmpl
+++ b/templates/bootstrap.js.tmpl
@@ -22,16 +22,27 @@ function startup(params, reason)
Services.obs.addObserver(RequireObserver, "{{metadata.get('general', 'basename')}}-require", true);
onShutdown.add(function()
{
Services.obs.removeObserver(RequireObserver, "{{metadata.get('general', 'basename')}}-require");
});
{%- set hasShutdownHandlers = True %}
{%- endif %}
+ {%- if hasWebExtension %}
+ let port = params.webExtension.startup().then(({browser}) =>
+ {
+ return new Promise((resolve, reject) =>
+ {
+ browser.runtime.onConnect.addListener(resolve);
+ });
+ });
+ require.scopes.webextension = {exports: port};
+ {%- endif %}
+
require("main");
}
function shutdown(params, reason)
{
{%- if chromeWindows %}
let windowNames = {{chromeWindows|json}};
for (let i = 0; i < windowNames.length; i++)
« no previous file with comments | « packagerGecko.py ('k') | templates/install.rdf.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld