diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-08-18 20:51:19 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-09-02 19:33:28 -0400 |
commit | 53aad0bef68bf6930b684fda4a25e1a045cd800e (patch) | |
tree | 4e91dd4f3e6bac8ceefd7ecb321d15c024459f3f /ext/bg | |
parent | 42ec3e2a43dfd9ac0748ca7c364cef2b44f625a2 (diff) |
Fix messaging issues when iframes are present in the document
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/api.js | 5 | ||||
-rw-r--r-- | ext/bg/js/backend.js | 4 | ||||
-rw-r--r-- | ext/bg/js/search-frontend.js | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js index 4b2bacd7..b8ef4362 100644 --- a/ext/bg/js/api.js +++ b/ext/bg/js/api.js @@ -205,3 +205,8 @@ function apiForward(action, params, sender) { chrome.tabs.sendMessage(tabId, {action, params}, (response) => resolve(response)); }); } + +function apiFrameInformationGet(sender) { + const frameId = sender.frameId; + return Promise.resolve({frameId}); +} diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 8f99c13a..39fd4288 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -127,6 +127,10 @@ class Backend { forward: ({action, params}) => { forward(apiForward(action, params, sender), callback); + }, + + frameInformationGet: () => { + forward(apiFrameInformationGet(sender), callback); } }; diff --git a/ext/bg/js/search-frontend.js b/ext/bg/js/search-frontend.js index 77aa4052..840a1ea8 100644 --- a/ext/bg/js/search-frontend.js +++ b/ext/bg/js/search-frontend.js @@ -25,8 +25,8 @@ async function searchFrontendSetup() { '/fg/js/api.js', '/fg/js/frontend-api-receiver.js', '/fg/js/popup.js', - '/fg/js/popup-proxy-host.js', '/fg/js/util.js', + '/fg/js/popup-proxy-host.js', '/fg/js/frontend.js' ]; for (const src of scriptSrcs) { |