Skip to content

Commit 01f9a2e

Browse files
Merge 1552495 into 9e20959
2 parents 9e20959 + 1552495 commit 01f9a2e

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

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,

0 commit comments

Comments
 (0)