some minor changes for releasing the extension and revert failed publish PR #1123 (#1132)

* improve extension bundle

* Revert "Version Packages (alpha) (#1123)"

This reverts commit 39f8c24f1d.
This commit is contained in:
Yun Feng
2023-02-15 09:32:43 +11:00
committed by GitHub
parent 28111c14b1
commit 033d2d18b4
20 changed files with 56 additions and 199 deletions

View File

@@ -40,7 +40,7 @@ void (() => {
);
if (isInCrossOriginIFrame()) {
void initCrossOriginIframe();
} else {
} else if (window === window.top) {
void initMainPage();
}
})();
@@ -154,7 +154,9 @@ async function initMainPage() {
}
// Before unload pages, cache the new events in the local storage.
window.addEventListener('beforeunload', () => {
window.addEventListener('beforeunload', (event) => {
event.preventDefault();
if (newEvents.length === 0) return;
void Browser.storage.local.set({
[LocalDataKey.bufferedEvents]: bufferedEvents.concat(newEvents),
});

View File

@@ -43,7 +43,13 @@ const messageHandler = (
startRecord(data.config || {});
},
[MessageName.StopRecord]: () => {
if (stopFn) stopFn();
if (stopFn) {
try {
stopFn();
} catch (e) {
//
}
}
postMessage({
message: MessageName.RecordStopped,
events,