User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; FDM) Build Identifier: location.href throws error when use not registered protocol Reproducible: Always Steps to Reproduce: run attachement Actual Results: throws error Expected Results: no error other browsers do not throw errors
Summary: location.href throw error → location.href throws error
Link in raw HTML do not throw errors. <a href="custom://link">custom://link</a> Only JS location.href <span onclick="location.href='custom://link'">custom://link</span>
There's no way to throw an exception from the <a href>, since that's not in script. You presumably want the browser to silently do nothing instead. It's not clear to me why this would be better than telling the calling script that the load is flatly not possible, but in any case it needs spec work.
The spec  requires raising a SYNTAX_ERR if resolving the URL is unsuccessful. However, thanks to the URI people, the resolving algorithm is useless ATM.  <http://www.whatwg.org/html/#dom-location-href>
So setting href invokes http://url.spec.whatwg.org/#dom-url-href which invokes stuff from http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#location which throws an exception. I guess the question is whether that should be caught or not.
This is per the standard.
Status: UNCONFIRMED → RESOLVED
Last Resolved: a year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.