File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { DDGPromise } from '../utils';
22import ContentFeature from '../content-feature' ;
33import { createPageWorldBridge } from './message-bridge/create-page-world-bridge.js' ;
44
5+ const store = { } ;
6+
57export default class NavigatorInterface extends ContentFeature {
68 load ( args ) {
79 if ( this . matchConditionalFeatureSetting ( 'privilegedDomains' ) . length ) {
@@ -35,7 +37,13 @@ export default class NavigatorInterface extends ContentFeature {
3537 * @throws {Error }
3638 */
3739 createMessageBridge ( featureName ) {
38- return createPageWorldBridge ( featureName , args . messageSecret ) ;
40+ const existingBridge = store [ featureName ] ;
41+ if ( existingBridge ) return existingBridge ;
42+
43+ const bridge = createPageWorldBridge ( featureName , args . messageSecret ) ;
44+
45+ store [ featureName ] = bridge ;
46+ return bridge ;
3947 } ,
4048 } ,
4149 enumerable : true ,
You can’t perform that action at this time.
0 commit comments