Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 9330601

Browse files
committed
[relay] add Relay hook to Firefox
1 parent c85ab74 commit 9330601

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

shells/firefox/src/GlobalHook.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@
1111
'use strict';
1212

1313
var installGlobalHook = require('../../../backend/installGlobalHook.js');
14-
var source = ';(' + installGlobalHook.toString() + ')(window);';
14+
var installRelayHook = require('../../../plugins/Relay/installRelayHook.js');
15+
16+
var js = (
17+
';(' + installGlobalHook.toString() + '(window))' +
18+
';(' + installRelayHook.toString() + '(window))'
19+
);
1520

1621
var script = document.createElement('script');
17-
script.textContent = source;
22+
script.textContent = js;
1823
document.documentElement.appendChild(script);
1924
script.parentNode.removeChild(script);

shells/firefox/src/backend.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
var Agent = require('../../../agent/Agent');
1414
var Bridge = require('../../../agent/Bridge');
1515
var setupHighlighter = require('../../../frontend/Highlighter/setup');
16+
var setupRelay = require('../../../plugins/Relay/backend');
1617

1718
var inject = require('../../../agent/inject');
1819

@@ -80,6 +81,8 @@ function setup() {
8081
listeners = [];
8182
});
8283

84+
setupRelay(bridge, agent, window.__REACT_DEVTOOLS_GLOBAL_HOOK__);
85+
8386
if (window.document && window.document.createElement) {
8487
setupHighlighter(agent);
8588
}

0 commit comments

Comments
 (0)