Skip to content

Commit

Permalink
Reduced logging and meta fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Mar 27, 2023
1 parent d1358d6 commit 4d8ec50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions source/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ async function handleAction({id}) {
...defaults,
code: 'typeof window.startGT === "function"',
});
console.log(alreadyInjected);
if (alreadyInjected) {
return browser.tabs.executeScript(id, {...defaults, code: 'startGT()'});
}
Expand Down Expand Up @@ -64,11 +63,10 @@ chrome.runtime.onConnect.addListener(handlePortListenerErrors(async port => {

console.log('will open socket');
const socket = new WebSocket('ws://localhost:' + WebSocketPort);
const event = await Promise.race([
await Promise.race([
oneEvent(socket, 'open'),
oneEvent(socket, 'error'),
]);
console.log(event);

const onSocketClose = () => port.postMessage({close: true});
socket.addEventListener('close', onSocketClose);
Expand All @@ -79,7 +77,6 @@ chrome.runtime.onConnect.addListener(handlePortListenerErrors(async port => {
console.log('got message from script', message);
socket.send(message);
});
console.log(port);
port.onDisconnect.addListener(() => {
socket.removeEventListener('close', onSocketClose);
socket.close();
Expand Down
1 change: 1 addition & 0 deletions source/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ <h3>Info</h3>
<p>You can find information on how GhostText works and how to troubleshoot any issues on <a href="https://github.com/fregante/GhostText">its repo</a>.</p>
<p>If you find this useful, consider supporting its development by <a href="https://github.com/sponsors/fregante">donating or sponsoring me on GitHub</a>.</p>
<p>Made with 🍕 by <a href="https://fregante.com">fregante</a>.</p>
<!-- This breaks when using `npm run build`; Use `npm run prepare:safari` -->
<script type="module" src="options.js"></script>

0 comments on commit 4d8ec50

Please sign in to comment.