Created attachment 596786 [details] Screen shot 2012-02-13 at 2.06.20 PM.png User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.11 Safari/535.19 Steps to reproduce: Try changing the document protocol via: document.location.protocol = 'https:'; Actual results: The following error is raised: Error: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMLocation.protocol] Expected results: The page should redirect to the changed protocol [if a protocol change has occurred]
I noticed this only started happening as of Feb 10, 2012, perhaps related to the 10.1 release, but it could be unrelated.
*10.0.1 release (In reply to Ian Chan from comment #1) > I noticed this only started happening as of Feb 10, 2012, perhaps related to > the 10.1 release, but it could be unrelated.
I see the same behavior in at least Firefox 9, Firefox 4, and Firefox 3.6. So this is certainly not related to 10.0.1 release. Using "https" (note no trailing ':') works fine. The part about stripping ':' if present is new-ish in the spec. I guess we should do that. Jonas, who was working on the URI decomposition stuff?
I don't know that anyone is working on that right now
A script like var anchor = document.createElement("a"); anchor.href = "http://www.mozilla.org/"; anchor.protocol = "https:fooooooooooo"; alert(anchor.href); seems to work as expected. Probably |location.protocol| should use the same URI parser/filter, rather than implement a new one. http://hg.mozilla.org/mozilla-central/annotate/93439ef24979/content/base/src/Link.cpp#l144
However, bug 668680 seems the actual blocker rather than bug 676049.
Reproduced in FF Developer Edition 51.0a2, with `location.protocol = location.protocol`. I sent a bug report to WHATWG HTML in order to get some statements clarified, confirming that the URI parser gets the blame. : https://github.com/whatwg/html/issues/2118#issuecomment-263805414