mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-08 14:49:38 +03:00
Don't save pending tab ids on macOS
This commit is contained in:
parent
10e948edc9
commit
9b4fc66219
@ -26,7 +26,7 @@ browser.tabs.onUpdated.addListener(handleUpdated);
|
||||
|
||||
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
if (request.subject === "process-inpage-message") {
|
||||
pendingTabIds[request.message.id] = sender.tab.id;
|
||||
didMakeRequest(request.message.id, sender.tab.id);
|
||||
browser.runtime.sendNativeMessage("mac.tokenary.io", request.message, function(response) {
|
||||
sendResponse(response)
|
||||
});
|
||||
@ -39,7 +39,7 @@ browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
browser.browserAction.onClicked.addListener(function(tab) {
|
||||
const id = new Date().getTime() + Math.floor(Math.random() * 1000);
|
||||
const request = {id: id, name: "switchAccount", object: {}, address: "", proxy: true};
|
||||
pendingTabIds[request.id] = tab.id;
|
||||
didMakeRequest(request.id, tab.id);
|
||||
// TODO: pass current network id
|
||||
// TODO: pass favicon
|
||||
// TODO: pass host here as well
|
||||
|
3
Safari iOS/Resources/ios-specific-background.js
Normal file
3
Safari iOS/Resources/ios-specific-background.js
Normal file
@ -0,0 +1,3 @@
|
||||
function didMakeRequest(requestId, tabId) {
|
||||
pendingTabIds[requestId] = tabId;
|
||||
}
|
@ -15,7 +15,7 @@
|
||||
},
|
||||
|
||||
"background": {
|
||||
"scripts": [ "background.js" ],
|
||||
"scripts": [ "background.js", "ios-specific-background.js" ],
|
||||
"persistent": false
|
||||
},
|
||||
|
||||
|
3
Safari macOS/Resources/macos-specific-background.js
Normal file
3
Safari macOS/Resources/macos-specific-background.js
Normal file
@ -0,0 +1,3 @@
|
||||
function didMakeRequest(requestId, tabId) {
|
||||
|
||||
}
|
@ -15,7 +15,7 @@
|
||||
},
|
||||
|
||||
"background": {
|
||||
"scripts": [ "background.js" ],
|
||||
"scripts": [ "background.js", "macos-specific-background.js" ],
|
||||
"persistent": true
|
||||
},
|
||||
|
||||
|
@ -88,6 +88,8 @@
|
||||
2CC89471269A334A00879245 /* UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CC89470269A334A00879245 /* UserDefaults.swift */; };
|
||||
2CC8C5A22767D3B30083FB1B /* GasPriceSliderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CC8C5A02767D3B30083FB1B /* GasPriceSliderTableViewCell.swift */; };
|
||||
2CC8C5A32767D3B30083FB1B /* GasPriceSliderTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2CC8C5A12767D3B30083FB1B /* GasPriceSliderTableViewCell.xib */; };
|
||||
2CC8C5A5276A52670083FB1B /* ios-specific-background.js in Resources */ = {isa = PBXBuildFile; fileRef = 2CC8C5A4276A52670083FB1B /* ios-specific-background.js */; };
|
||||
2CC8C5A7276A54DA0083FB1B /* macos-specific-background.js in Resources */ = {isa = PBXBuildFile; fileRef = 2CC8C5A6276A54DA0083FB1B /* macos-specific-background.js */; };
|
||||
2CCEB83727594E2A00768473 /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 2CCEB83627594E2A00768473 /* manifest.json */; };
|
||||
2CCEB84527594E2A00768473 /* Safari iOS.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 2CCEB82D27594E2A00768473 /* Safari iOS.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
2CD0669126B5537B00728C20 /* TokenaryWallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD0668B26B2142000728C20 /* TokenaryWallet.swift */; };
|
||||
@ -281,6 +283,8 @@
|
||||
2CC89470269A334A00879245 /* UserDefaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaults.swift; sourceTree = "<group>"; };
|
||||
2CC8C5A02767D3B30083FB1B /* GasPriceSliderTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GasPriceSliderTableViewCell.swift; sourceTree = "<group>"; };
|
||||
2CC8C5A12767D3B30083FB1B /* GasPriceSliderTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GasPriceSliderTableViewCell.xib; sourceTree = "<group>"; };
|
||||
2CC8C5A4276A52670083FB1B /* ios-specific-background.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "ios-specific-background.js"; sourceTree = "<group>"; };
|
||||
2CC8C5A6276A54DA0083FB1B /* macos-specific-background.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "macos-specific-background.js"; sourceTree = "<group>"; };
|
||||
2CCEB82D27594E2A00768473 /* Safari iOS.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Safari iOS.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2CCEB83627594E2A00768473 /* manifest.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = manifest.json; sourceTree = "<group>"; };
|
||||
2CCEB84227594E2A00768473 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
@ -371,6 +375,7 @@
|
||||
children = (
|
||||
2C09CBA8273979C1009AD39B /* manifest.json */,
|
||||
2CFDDF4B2765416F00F89019 /* macos-specific-content.js */,
|
||||
2CC8C5A6276A54DA0083FB1B /* macos-specific-background.js */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
@ -632,6 +637,7 @@
|
||||
children = (
|
||||
2CCEB83627594E2A00768473 /* manifest.json */,
|
||||
2CFDDF4D2765417D00F89019 /* ios-specific-content.js */,
|
||||
2CC8C5A4276A52670083FB1B /* ios-specific-background.js */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
@ -887,6 +893,7 @@
|
||||
files = (
|
||||
2CB3845C27654EB300A189B9 /* _locales in Resources */,
|
||||
2CB3845D27654EB300A189B9 /* images in Resources */,
|
||||
2CC8C5A7276A54DA0083FB1B /* macos-specific-background.js in Resources */,
|
||||
2CEFEB16274D5DCA00CE23BD /* inpage.js in Resources */,
|
||||
2C09CBAB273979C1009AD39B /* background.js in Resources */,
|
||||
2C09CBA9273979C1009AD39B /* manifest.json in Resources */,
|
||||
@ -931,6 +938,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2CC8C5A5276A52670083FB1B /* ios-specific-background.js in Resources */,
|
||||
2CB3845A27654EA900A189B9 /* _locales in Resources */,
|
||||
2CB3845B27654EA900A189B9 /* images in Resources */,
|
||||
2CE0594027640E8E0042D844 /* background.js in Resources */,
|
||||
|
Loading…
Reference in New Issue
Block a user