Skip to content

Commit 313a212

Browse files
Release build 8.8.0 [ci release]
1 parent 4588fd2 commit 313a212

File tree

12 files changed

+88
-81
lines changed

12 files changed

+88
-81
lines changed

CHANGELOG.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
- Revert "Add support for non isolated messaging (#1586)" (#1591)
2-
- enable snapshot tests in CI (#1588)
1+
- Try catch notify messaging (#1592)
2+
- Revert "Revert "Add support for non isolated messaging (#1586)" (#1591)" (#1593)

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,9 +3211,12 @@
32113211
addDebugFlag() {
32123212
if (__privateGet(this, _isDebugFlagSet)) return;
32133213
__privateSet(this, _isDebugFlagSet, true);
3214-
this.messaging?.notify("addDebugFlag", {
3215-
flag: this.name
3216-
});
3214+
try {
3215+
this.messaging?.notify("addDebugFlag", {
3216+
flag: this.name
3217+
});
3218+
} catch (_e) {
3219+
}
32173220
}
32183221
/**
32193222
* Define a property descriptor with debug flags.
@@ -5976,24 +5979,17 @@
59765979
const userUnprotectedDomains = $USER_UNPROTECTED_DOMAINS$;
59775980
const userPreferences = $USER_PREFERENCES$;
59785981
const processedConfig = processConfig(config, userUnprotectedDomains, userPreferences, platformSpecificFeatures);
5982+
const handlerNames = [];
59795983
if (false) {
5980-
processedConfig.messagingConfig = new WebkitMessagingConfig({
5981-
webkitMessageHandlerNames: ["contentScopeScriptsIsolated"],
5982-
secret: "",
5983-
hasModernWebkitAPI: true
5984-
});
5984+
handlerNames.push("contentScopeScriptsIsolated");
59855985
} else {
5986-
processedConfig.messagingConfig = new TestTransportConfig({
5987-
notify() {
5988-
},
5989-
request: async () => {
5990-
},
5991-
subscribe() {
5992-
return () => {
5993-
};
5994-
}
5995-
});
5986+
handlerNames.push("contentScopeScripts");
59965987
}
5988+
processedConfig.messagingConfig = new WebkitMessagingConfig({
5989+
webkitMessageHandlerNames: handlerNames,
5990+
secret: "",
5991+
hasModernWebkitAPI: true
5992+
});
59975993
load({
59985994
platform: processedConfig.platform,
59995995
site: processedConfig.site,

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3766,9 +3766,12 @@
37663766
addDebugFlag() {
37673767
if (__privateGet(this, _isDebugFlagSet)) return;
37683768
__privateSet(this, _isDebugFlagSet, true);
3769-
this.messaging?.notify("addDebugFlag", {
3770-
flag: this.name
3771-
});
3769+
try {
3770+
this.messaging?.notify("addDebugFlag", {
3771+
flag: this.name
3772+
});
3773+
} catch (_e) {
3774+
}
37723775
}
37733776
/**
37743777
* Define a property descriptor with debug flags.
@@ -12098,24 +12101,17 @@
1209812101
const userUnprotectedDomains = $USER_UNPROTECTED_DOMAINS$;
1209912102
const userPreferences = $USER_PREFERENCES$;
1210012103
const processedConfig = processConfig(config2, userUnprotectedDomains, userPreferences, platformSpecificFeatures);
12104+
const handlerNames = [];
1210112105
if (true) {
12102-
processedConfig.messagingConfig = new WebkitMessagingConfig({
12103-
webkitMessageHandlerNames: ["contentScopeScriptsIsolated"],
12104-
secret: "",
12105-
hasModernWebkitAPI: true
12106-
});
12106+
handlerNames.push("contentScopeScriptsIsolated");
1210712107
} else {
12108-
processedConfig.messagingConfig = new TestTransportConfig({
12109-
notify() {
12110-
},
12111-
request: async () => {
12112-
},
12113-
subscribe() {
12114-
return () => {
12115-
};
12116-
}
12117-
});
12108+
handlerNames.push("contentScopeScripts");
1211812109
}
12110+
processedConfig.messagingConfig = new WebkitMessagingConfig({
12111+
webkitMessageHandlerNames: handlerNames,
12112+
secret: "",
12113+
hasModernWebkitAPI: true
12114+
});
1211912115
load({
1212012116
platform: processedConfig.platform,
1212112117
site: processedConfig.site,

build/android/autofillPasswordImport.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,9 +2337,12 @@
23372337
addDebugFlag() {
23382338
if (__privateGet(this, _isDebugFlagSet)) return;
23392339
__privateSet(this, _isDebugFlagSet, true);
2340-
this.messaging?.notify("addDebugFlag", {
2341-
flag: this.name
2342-
});
2340+
try {
2341+
this.messaging?.notify("addDebugFlag", {
2342+
flag: this.name
2343+
});
2344+
} catch (_e) {
2345+
}
23432346
}
23442347
/**
23452348
* Define a property descriptor with debug flags.

build/android/brokerProtection.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3730,9 +3730,12 @@
37303730
addDebugFlag() {
37313731
if (__privateGet(this, _isDebugFlagSet)) return;
37323732
__privateSet(this, _isDebugFlagSet, true);
3733-
this.messaging?.notify("addDebugFlag", {
3734-
flag: this.name
3735-
});
3733+
try {
3734+
this.messaging?.notify("addDebugFlag", {
3735+
flag: this.name
3736+
});
3737+
} catch (_e) {
3738+
}
37363739
}
37373740
/**
37383741
* Define a property descriptor with debug flags.

build/android/contentScope.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3722,9 +3722,12 @@
37223722
addDebugFlag() {
37233723
if (__privateGet(this, _isDebugFlagSet)) return;
37243724
__privateSet(this, _isDebugFlagSet, true);
3725-
this.messaging?.notify("addDebugFlag", {
3726-
flag: this.name
3727-
});
3725+
try {
3726+
this.messaging?.notify("addDebugFlag", {
3727+
flag: this.name
3728+
});
3729+
} catch (_e) {
3730+
}
37283731
}
37293732
/**
37303733
* Define a property descriptor with debug flags.

build/chrome-mv3/inject.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,9 +3167,12 @@
31673167
addDebugFlag() {
31683168
if (__privateGet(this, _isDebugFlagSet)) return;
31693169
__privateSet(this, _isDebugFlagSet, true);
3170-
this.messaging?.notify("addDebugFlag", {
3171-
flag: this.name
3172-
});
3170+
try {
3171+
this.messaging?.notify("addDebugFlag", {
3172+
flag: this.name
3173+
});
3174+
} catch (_e) {
3175+
}
31733176
}
31743177
/**
31753178
* Define a property descriptor with debug flags.

build/firefox/inject.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,9 +3167,12 @@
31673167
addDebugFlag() {
31683168
if (__privateGet(this, _isDebugFlagSet)) return;
31693169
__privateSet(this, _isDebugFlagSet, true);
3170-
this.messaging?.notify("addDebugFlag", {
3171-
flag: this.name
3172-
});
3170+
try {
3171+
this.messaging?.notify("addDebugFlag", {
3172+
flag: this.name
3173+
});
3174+
} catch (_e) {
3175+
}
31733176
}
31743177
/**
31753178
* Define a property descriptor with debug flags.

build/integration/contentScope.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5219,9 +5219,12 @@
52195219
addDebugFlag() {
52205220
if (__privateGet(this, _isDebugFlagSet)) return;
52215221
__privateSet(this, _isDebugFlagSet, true);
5222-
this.messaging?.notify("addDebugFlag", {
5223-
flag: this.name
5224-
});
5222+
try {
5223+
this.messaging?.notify("addDebugFlag", {
5224+
flag: this.name
5225+
});
5226+
} catch (_e) {
5227+
}
52255228
}
52265229
/**
52275230
* Define a property descriptor with debug flags.

build/windows/contentScope.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4752,9 +4752,12 @@
47524752
addDebugFlag() {
47534753
if (__privateGet(this, _isDebugFlagSet)) return;
47544754
__privateSet(this, _isDebugFlagSet, true);
4755-
this.messaging?.notify("addDebugFlag", {
4756-
flag: this.name
4757-
});
4755+
try {
4756+
this.messaging?.notify("addDebugFlag", {
4757+
flag: this.name
4758+
});
4759+
} catch (_e) {
4760+
}
47584761
}
47594762
/**
47604763
* Define a property descriptor with debug flags.

injected/entry-points/apple.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import { load, init } from '../src/content-scope-features.js';
55
import { processConfig, platformSpecificFeatures } from './../src/utils';
6-
import { WebkitMessagingConfig, TestTransportConfig } from '../../messaging/index.js';
6+
import { WebkitMessagingConfig } from '../../messaging/index.js';
77

88
function initCode() {
99
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
@@ -15,27 +15,17 @@ function initCode() {
1515

1616
const processedConfig = processConfig(config, userUnprotectedDomains, userPreferences, platformSpecificFeatures);
1717

18+
const handlerNames = [];
1819
if (import.meta.injectName === 'apple-isolated') {
19-
processedConfig.messagingConfig = new WebkitMessagingConfig({
20-
webkitMessageHandlerNames: ['contentScopeScriptsIsolated'],
21-
secret: '',
22-
hasModernWebkitAPI: true,
23-
});
20+
handlerNames.push('contentScopeScriptsIsolated');
2421
} else {
25-
processedConfig.messagingConfig = new TestTransportConfig({
26-
notify() {
27-
// noop
28-
},
29-
request: async () => {
30-
// noop
31-
},
32-
subscribe() {
33-
return () => {
34-
// noop
35-
};
36-
},
37-
});
22+
handlerNames.push('contentScopeScripts');
3823
}
24+
processedConfig.messagingConfig = new WebkitMessagingConfig({
25+
webkitMessageHandlerNames: handlerNames,
26+
secret: '',
27+
hasModernWebkitAPI: true,
28+
});
3929

4030
load({
4131
platform: processedConfig.platform,

injected/src/content-feature.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,13 @@ export default class ContentFeature extends ConfigFeature {
217217
addDebugFlag() {
218218
if (this.#isDebugFlagSet) return;
219219
this.#isDebugFlagSet = true;
220-
this.messaging?.notify('addDebugFlag', {
221-
flag: this.name,
222-
});
220+
try {
221+
this.messaging?.notify('addDebugFlag', {
222+
flag: this.name,
223+
});
224+
} catch (_e) {
225+
// Ignore thrown error from a potentially missing handler (on WebKit).
226+
}
223227
}
224228

225229
/**

0 commit comments

Comments
 (0)