{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/1209","labels_url":"https://api.github.com/repos/facebook/react-native/issues/1209/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/1209/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/1209/events","html_url":"https://github.com/facebook/react-native/issues/1209","id":74530073,"number":1209,"title":"[Chrome Debugger] \"Not allowed to load local resource\" when debugging in Chrome and loading main.jsbundle","user":{"login":"itsananderson","id":516559,"avatar_url":"https://avatars.githubusercontent.com/u/516559?v=3","gravatar_id":"","url":"https://api.github.com/users/itsananderson","html_url":"https://github.com/itsananderson","followers_url":"https://api.github.com/users/itsananderson/followers","following_url":"https://api.github.com/users/itsananderson/following{/other_user}","gists_url":"https://api.github.com/users/itsananderson/gists{/gist_id}","starred_url":"https://api.github.com/users/itsananderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itsananderson/subscriptions","organizations_url":"https://api.github.com/users/itsananderson/orgs","repos_url":"https://api.github.com/users/itsananderson/repos","events_url":"https://api.github.com/users/itsananderson/events{/privacy}","received_events_url":"https://api.github.com/users/itsananderson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-05-08T23:30:45Z","updated_at":"2015-09-07T06:07:08Z","closed_at":null,"body":"When you uncomment this line in a newly generated project to use the main.jsbundle file, debugging in Chrome stops working.\r\n\r\n```objective-c\r\njsCodeLocation = [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\r\n```\r\n\r\nWhen you \"Debug in Chrome\":\r\n\r\n```\r\nNot allowed to load local resource:  \r\nfile:///Users/.../Library/Developer/CoreSimulator/Devices/FDEBA9B8-…tion/5EFF3E8A-F067-4DDB-A023-A528FB9D61DE/.../main.jsbundle\r\n```\r\n\r\nOf course, this is because the page is trying to load a `file://` script. Totally expected, but it does make it painful to debug scenarios that might only occur when you load from the bundle.\r\n\r\nI actually tweaked the packager code to work around this.\r\n\r\nIn `packager/debugger.html`, I updated the loadScript function to check for the `file://` protocol, and proxy the request through the packager. e.g. `http://localhost:8081/file://...`.\r\n\r\nThen in `packager/packager.js` I updated `getDevToolsLauncher` to check for `/file://` in the path, and to serve that file.\r\n\r\nIs this workaround something you'd be interested in me sending a PR for, or is the current behavior intentional?\r\n\r\nObviously the main drawback of my workaround is that it exposes a way to fetch arbitrary files from the machine. Considering the packager/debugger already allows any connected websocket clients to cause arbitrary code execution through `executeApplicationScript`, is that a concern?"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/138197434","html_url":"https://github.com/facebook/react-native/issues/1209#issuecomment-138197434","issue_url":"https://api.github.com/repos/facebook/react-native/issues/1209","id":138197434,"user":{"login":"ohadpartuck","id":2236337,"avatar_url":"https://avatars.githubusercontent.com/u/2236337?v=3","gravatar_id":"","url":"https://api.github.com/users/ohadpartuck","html_url":"https://github.com/ohadpartuck","followers_url":"https://api.github.com/users/ohadpartuck/followers","following_url":"https://api.github.com/users/ohadpartuck/following{/other_user}","gists_url":"https://api.github.com/users/ohadpartuck/gists{/gist_id}","starred_url":"https://api.github.com/users/ohadpartuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohadpartuck/subscriptions","organizations_url":"https://api.github.com/users/ohadpartuck/orgs","repos_url":"https://api.github.com/users/ohadpartuck/repos","events_url":"https://api.github.com/users/ohadpartuck/events{/privacy}","received_events_url":"https://api.github.com/users/ohadpartuck/received_events","type":"User","site_admin":false},"created_at":"2015-09-07T06:07:08Z","updated_at":"2015-09-07T06:07:08Z","body":"@facebook-github-bot-8 why is it taking so long long to fix this? it seems to bug a lot of people ...\r\nReact-native is important enough to be urgent :-)\r\n"}}