initial commit
This commit is contained in:
12
extension/background.js
Normal file
12
extension/background.js
Normal file
@ -0,0 +1,12 @@
|
||||
let port = null;
|
||||
|
||||
browser.runtime.onMessage.addListener(message => {
|
||||
if (port == null || port.error) {
|
||||
port = browser.runtime.connectNative('cheetah');
|
||||
}
|
||||
try {
|
||||
port.postMessage(message);
|
||||
} catch (error) {
|
||||
port = null;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user