Skip to content

Commit

Permalink
fix: pass correct chrome connct instance
Browse files Browse the repository at this point in the history
  • Loading branch information
diegodelrieu committed Apr 22, 2024
1 parent 8325080 commit e0bfc3f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/with-plasmo/src/contents/content.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { relay } from 'trpc-browser/relay';
import { autoConnect } from 'trpc-browser/shared/chrome';

void autoConnect(chrome, (port) => {
return relay(window, port); // return so it has the cleanup function for disconnect
}).then(() => {
void autoConnect(
() => chrome.runtime.connect(),
(port) => {
return relay(window, port); // return so it has the cleanup function for disconnect
},
).then(() => {
return console.log('Content script loaded - bridge initialized');
});

0 comments on commit e0bfc3f

Please sign in to comment.