* improve extension bundle
* Revert "Version Packages (alpha) (#1123)"
This reverts commit 39f8c24f1d.
This commit is contained in:
@@ -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),
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user