mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Have the chrome debugger run javascript within a web worker, to remove the global document.
Summary: To make the chrome debugger environment consisten with the JSC executer environment, where there is no `window.document`, make the chrome debugger run the javascript inside a web worker. This fixes #1473 Closes https://github.com/facebook/react-native/pull/1632 Reviewed By: @martinbigio Differential Revision: D2471710 Pulled By: @vjeux
This commit is contained in:
committed by
facebook-github-bot-9
parent
200d9af315
commit
8db35d492b
@@ -184,6 +184,12 @@ function getDevToolsLauncher(options) {
|
||||
var debuggerPath = path.join(__dirname, 'debugger.html');
|
||||
res.writeHead(200, {'Content-Type': 'text/html'});
|
||||
fs.createReadStream(debuggerPath).pipe(res);
|
||||
|
||||
} else if (req.url === '/debuggerWorker.js') {
|
||||
var workerPath = path.join(__dirname, 'debuggerWorker.js');
|
||||
res.writeHead(200, {'Content-Type': 'application/javascript'});
|
||||
fs.createReadStream(workerPath).pipe(res);
|
||||
|
||||
} else if (req.url === '/launch-chrome-devtools') {
|
||||
var debuggerURL = 'http://localhost:' + options.port + '/debugger-ui';
|
||||
var script = 'launchChromeDevTools.applescript';
|
||||
|
||||
Reference in New Issue
Block a user