{"action":"created","issue":{"url":"https://api.github.com/repos/atom/electron/issues/2261","labels_url":"https://api.github.com/repos/atom/electron/issues/2261/labels{/name}","comments_url":"https://api.github.com/repos/atom/electron/issues/2261/comments","events_url":"https://api.github.com/repos/atom/electron/issues/2261/events","html_url":"https://github.com/atom/electron/issues/2261","id":95648206,"number":2261,"title":"net::ERR_INVALID_URL when intercepting http","user":{"login":"zsalzbank","id":939977,"avatar_url":"https://avatars.githubusercontent.com/u/939977?v=3","gravatar_id":"","url":"https://api.github.com/users/zsalzbank","html_url":"https://github.com/zsalzbank","followers_url":"https://api.github.com/users/zsalzbank/followers","following_url":"https://api.github.com/users/zsalzbank/following{/other_user}","gists_url":"https://api.github.com/users/zsalzbank/gists{/gist_id}","starred_url":"https://api.github.com/users/zsalzbank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsalzbank/subscriptions","organizations_url":"https://api.github.com/users/zsalzbank/orgs","repos_url":"https://api.github.com/users/zsalzbank/repos","events_url":"https://api.github.com/users/zsalzbank/events{/privacy}","received_events_url":"https://api.github.com/users/zsalzbank/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-17T12:33:49Z","updated_at":"2015-07-17T12:52:56Z","closed_at":null,"body":"I have a simple app that intercepts the `http` protocol, and depending on the parsed URL, either modifies the request, or leaves it as it was. In the test app below, I don't even do anything in the handler, just return `null`:\r\n\r\n```javascript\r\nvar app = require('app'),\r\n    BrowserWindow = require('browser-window');\r\n\r\nvar mainWindow = null;\r\n\r\napp.on('window-all-closed', app.quit);\r\n\r\napp.on('ready', function() {\r\n  mainWindow = new BrowserWindow({\r\n    width: 800,\r\n    height: 600\r\n  });\r\n\r\n  mainWindow.openDevTools({detach: true});\r\n\r\n  var protocol = require('protocol');\r\n  protocol.interceptProtocol('http', function(request) {\r\n    return null;\r\n  }, function(error, scheme) {\r\n    protocol.registerStandardSchemes(['http']);\r\n    mainWindow.loadUrl('https://www.google.com');\r\n  });\r\n});\r\n```\r\n\r\nWhen the program loads, it works fine because it is loading the `https` URL for google.  However, when I type `document.location = 'http://www.google.com'` in the console, I get a `net::ERR_INVALID_URL` error and the page becomes blank.  I would expect the URL to load normally because I returned `null` as stated [in the docs](https://github.com/atom/electron/blob/master/docs/api/protocol.md#protocolinterceptprotocolscheme-handler-callback).\r\n\r\nI am running `v0.30.0` on `Ubuntu 14.04`."},"comment":{"url":"https://api.github.com/repos/atom/electron/issues/comments/122265650","html_url":"https://github.com/atom/electron/issues/2261#issuecomment-122265650","issue_url":"https://api.github.com/repos/atom/electron/issues/2261","id":122265650,"user":{"login":"zsalzbank","id":939977,"avatar_url":"https://avatars.githubusercontent.com/u/939977?v=3","gravatar_id":"","url":"https://api.github.com/users/zsalzbank","html_url":"https://github.com/zsalzbank","followers_url":"https://api.github.com/users/zsalzbank/followers","following_url":"https://api.github.com/users/zsalzbank/following{/other_user}","gists_url":"https://api.github.com/users/zsalzbank/gists{/gist_id}","starred_url":"https://api.github.com/users/zsalzbank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsalzbank/subscriptions","organizations_url":"https://api.github.com/users/zsalzbank/orgs","repos_url":"https://api.github.com/users/zsalzbank/repos","events_url":"https://api.github.com/users/zsalzbank/events{/privacy}","received_events_url":"https://api.github.com/users/zsalzbank/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T12:52:56Z","updated_at":"2015-07-17T12:52:56Z","body":"It seems the problem occurs when there is a redirect.  If I navigate to `http://www.example.com`, there is no problem."}}