summaryrefslogtreecommitdiff
path: root/extension/background.js
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2021-02-07 02:46:07 -0800
committerOmar Rizwan <omar@omar.website>2021-02-07 02:46:07 -0800
commit33e5911cb2741ae57ef41ec245636733568f362c (patch)
tree0a71d851268f65ff225e85bc830012deb8b3e25d /extension/background.js
parenta465ad6a8fbb64184dcdcfa451dbb2aa9346ac2d (diff)
downloadTabFS-33e5911cb2741ae57ef41ec245636733568f362c.tar.gz
TabFS-33e5911cb2741ae57ef41ec245636733568f362c.zip
trying to just run straight from sandbox instead of xpc -- kinda works! blocked on libfuse
Diffstat (limited to 'extension/background.js')
-rw-r--r--extension/background.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/extension/background.js b/extension/background.js
index e6fba2b..f38f29e 100644
--- a/extension/background.js
+++ b/extension/background.js
@@ -713,19 +713,24 @@ async function onMessage(req) {
};
function tryConnect() {
+ console.log('start tryConnect');
port = chrome.runtime.connectNative('com.rsnous.tabfs');
+ console.log('start tryConnect - did connectNative');
port.onMessage.addListener(onMessage);
port.onDisconnect.addListener(p => {console.log('disconnect', p)});
+ console.log('tryConnect - about to sNM');
// Safari is very weird -- it has this native app that we have to talk to,
// so we poke that app to wake it up, get it to start the TabFS process,
// and get it to start calling us whenever TabFS wants to do an FS call.
// Is there a better way to do this?
if (chrome.runtime.getURL('/').startsWith('safari-web-extension://')) { // Safari-only
chrome.runtime.sendNativeMessage('com.rsnous.tabfs', {op: 'safari_did_connect'}, function(resp) {
+ console.log('didConnect resp');
console.log(resp);
});
}
+ console.log('tryConnect - did sNM');
}
if (!TESTING) {