Skip to content

Commit

Permalink
Get extension name for notification settings
Browse files Browse the repository at this point in the history
  • Loading branch information
stoodkev committed Oct 26, 2018
1 parent f7e2d4c commit 486e938
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions js/web_interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ setupInjection();

// Answering the handshakes
document.addEventListener('swHandshake', function(request) {
location.href = "javascript:steem_keychain.onGetHandshake(); void 0";
const req=JSON.stringify(request.detail);
if(request.detail.extension)
chrome.runtime.sendMessage(request.detail.extension,req );
else
location.href = "javascript:steem_keychain.onGetHandshake(); void 0";
});

// Answering the requests
Expand All @@ -25,7 +29,7 @@ document.addEventListener('swRequest', function(request) {
chrome.runtime.sendMessage({
command: "sendRequest",
request: req,
domain: window.location.hostname,
domain: req.extensionName||window.location.hostname,
request_id: req.request_id
});
} else {
Expand All @@ -49,6 +53,9 @@ chrome.runtime.onMessage.addListener(function(obj, sender, sendResp) {
});

function sendResponse(response) {
if(response.data.extension&&response.data.extensionName)
chrome.runtime.sendMessage(response.data.extension,JSON.stringify(response));
else
location.href = "javascript:steem_keychain.onGetResponse(" + JSON.stringify(response) + "); void 0";
}

Expand Down

0 comments on commit 486e938

Please sign in to comment.