[epiphany/pgriffis/web-extension-storage: 2/5] WebExtensions: Stub out some functions




commit 04f89db10a1ca8b1ce46f3784911c71854dc7851
Author: Patrick Griffis <pgriffis igalia com>
Date:   Mon May 23 20:53:56 2022 -0500

    WebExtensions: Stub out some functions
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1117>

 embed/web-process-extension/resources/js/webextensions.js | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/embed/web-process-extension/resources/js/webextensions.js 
b/embed/web-process-extension/resources/js/webextensions.js
index b68c8c189..33985f922 100644
--- a/embed/web-process-extension/resources/js/webextensions.js
+++ b/embed/web-process-extension/resources/js/webextensions.js
@@ -28,6 +28,9 @@ window.browser.notifications = {
     create: function (args, cb) { return ephy_message ('notifications.create', args, cb); },
 };
 
+// browser.extension is defined in ephy-webextension-common.c
+window.browser.extension.getViews = function (...args) { return []; };
+
 // browser.runtime is defined in webextensions-common.js
 window.browser.runtime.getBrowserInfo = function (args, cb) { return ephy_message ('runtime.getBrowserInfo', 
args, cb); };
 window.browser.runtime.connectNative = function (args, cb) { return ephy_message ('runtime.connectNative', 
args, cb); };
@@ -35,6 +38,9 @@ window.browser.runtime.openOptionsPage = function (args, cb) { return ephy_messa
 window.browser.runtime.setUninstallURL = function (args, cb) { return ephy_message 
('runtime.setUninstallURL', args, cb); };
 window.browser.runtime.onInstalled = new EphyEventListener ();
 window.browser.runtime.onMessageExternal = new EphyEventListener ();
+window.browser.runtime.sendNativeMessage = function (args) {
+  return new Promise ((resolve, reject) => { reject ('Unsupported API'); });
+};
 
 window.browser.pageAction = {
     setIcon: function (args, cb) { return ephy_message ('pageAction.setIcon', args, cb); },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]