{"action":"opened","issue":{"url":"https://api.github.com/repos/atom/electron/issues/3133","labels_url":"https://api.github.com/repos/atom/electron/issues/3133/labels{/name}","comments_url":"https://api.github.com/repos/atom/electron/issues/3133/comments","events_url":"https://api.github.com/repos/atom/electron/issues/3133/events","html_url":"https://github.com/atom/electron/issues/3133","id":112072224,"number":3133,"title":"how to access the node api from a remote page in electron?","user":{"login":"sureone","id":1161528,"avatar_url":"https://avatars.githubusercontent.com/u/1161528?v=3","gravatar_id":"","url":"https://api.github.com/users/sureone","html_url":"https://github.com/sureone","followers_url":"https://api.github.com/users/sureone/followers","following_url":"https://api.github.com/users/sureone/following{/other_user}","gists_url":"https://api.github.com/users/sureone/gists{/gist_id}","starred_url":"https://api.github.com/users/sureone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sureone/subscriptions","organizations_url":"https://api.github.com/users/sureone/orgs","repos_url":"https://api.github.com/users/sureone/repos","events_url":"https://api.github.com/users/sureone/events{/privacy}","received_events_url":"https://api.github.com/users/sureone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-19T05:04:45Z","updated_at":"2015-10-19T05:04:45Z","closed_at":null,"body":"In my electron app , I load the remote page(index.html) from remote url like(\"http://xxxx/index.html\"), then I am trying to send a ipc event to the main process then handle it , and failed, but if I put the the index.html in local fs and it is OK.\r\n\r\nSo my question is how to enable the page to access the node api (like require,ipc, etc.) from the remote page.\r\n\r\n------ (main process)\r\n```javascript\r\n  mainWindow = new BrowserWindow({width: 800, height: 600});\r\n  // and load the index.html of the app.\r\n  mainWindow.loadUrl('http://localhost:8080');\r\n  //mainWindow.loadUrl('file://' + __dirname + '/index.html');\r\nvar ipc = require('ipc');\r\n  ipc.on('spawn-ext-process', function () {\r\n  console.log(\"spawn-ext-process\");\r\n});\r\n```\r\n--------- http://localhost:8080/index.html (render process)\r\n```javascript\r\n<script>\r\n    var ipc = require('ipc');\r\n    ipc.send('spawn-ext-process');\r\n</script>\r\n```"}}