Skip to content

Commit 8686866

Browse files
committed
show errors in browser console when extension cannot connect to native app
1 parent 4998b07 commit 8686866

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

webext/add-on/background.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ function connected(port) {
1313

1414
// Initialize native port
1515
nativePort = browser.runtime.connectNative("credential_manager_shim");
16+
if (nativePort.error) {
17+
console.error(nativePort.error)
18+
throw nativePort.error
19+
}
1620
console.log(`connected to native app`)
1721
console.log(nativePort)
1822

@@ -80,4 +84,4 @@ function serializeRequest(options) {
8084

8185
// Listen for connections from content script
8286
console.log("Starting up credential_manager_shim background script")
83-
browser.runtime.onConnect.addListener(connected);
87+
browser.runtime.onConnect.addListener(connected);

0 commit comments

Comments
 (0)