Skip to content

Commit

Permalink
Updated changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRappl committed Mar 18, 2024
1 parent c6cc7ef commit 0e5dfde
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Piral Inspector Changelog

## 0.11.1

- Fixed issue of extension port being disconnected

## 0.11.0

- Migrated to manifest v3 (#26) @flouwrian
Expand Down
2 changes: 1 addition & 1 deletion src/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"name": "Piral Inspector",
"short_name": "pi-inspect",
"version": "0.11.0",
"version": "0.11.1",
"description": "The official Piral developer tools browser extension.",
"author": "smapiot",
"homepage_url": "https://piral.io",
Expand Down
16 changes: 7 additions & 9 deletions src/serviceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import { setIconAndPopup } from './icons';

const tabPorts: Record<number, Runtime.Port> = {};

/**
* Keep alive ping to counteract v3 30 seconds inactivity for service worker
*/

let intervalId

/**
* From contentScript.js to background.js (and maybe to devtools.js)
* s -------------------> o -------------------> t
Expand Down Expand Up @@ -43,8 +37,12 @@ runtime.onConnect.addListener((port) => {
if (port.name !== 'piral-inspector-host') {
return;
}

intervalId = setInterval(runtime.getPlatformInfo, 10000);

/**
* Keep alive ping to counteract v3 30s inactivity for service worker.
* We do something every 10s.
*/
const intervalId = setInterval(runtime.getPlatformInfo, 10_000);

let tabId: number;

Expand Down Expand Up @@ -72,7 +70,7 @@ runtime.onConnect.addListener((port) => {
port.onMessage.addListener(handler);

port.onDisconnect.addListener(() => {
clearInterval(intervalId)
clearInterval(intervalId);
port.onMessage.removeListener(handler);
delete tabPorts[tabId];
});
Expand Down

0 comments on commit 0e5dfde

Please sign in to comment.