slimerjs icon indicating copy to clipboard operation
slimerjs copied to clipboard

Error code: 301. Description: The URI scheme corresponds to an unknown protocol handler

Open offline opened this issue 9 years ago • 3 comments

The error is missing the URL which has unknown protocol.

For example. if example.com redirects you to market://details?id=com.UCMobile.intl you don't have a way to know what happend, all you will see is http://www.example.com "Error code: 301. Description: The URI scheme corresponds to an unknown protocol handler" and nothing about market://

In phantomjs, you will still receive the market://details?id=com.UCMobile.intl in page.onResourceRequested callback.

offline avatar Jan 03 '16 15:01 offline

Gecko network engine does not behave like Webkit's one. It does not generate a request for an unknown protocol, contrary to webkit. So with gecko, the error appears on the first request (redirection), whereas it appears during the second request (about market://...) with webkit. This is why we have the correct url with webkit.

It could be fixed in SlimerJS by adding an ugly hack. But I don't like ugly hack...

laurentj avatar Mar 06 '16 09:03 laurentj

But can be the URL of unknown protocol mentioned in error message at least?

offline avatar Mar 06 '16 11:03 offline

Hi, What ugly hack do you suggest? can Gecko be forced to generate the request to an unknown protocol?

I tried some workaround setting a custom user.js profile in the profile directory to register the "market" protocol, with following settings but still get the same unknown protocol error.

user_pref("network.protocol-handler.expose-all",true); user_pref("network.protocol-handler.expose.market",true); user_pref("network.protocol-handler.external.market",true); user_pref("network.protocol-handler.external-default",true); user_pref("network.protocol-handler.warn-external-default",false); user_pref("network.protocol-handler.warn-external.market",false); user_pref("network.protocol-handler.app.market","/usr/bin/handleprotocol");

("/usr/bin/handleprotocol" is a working executable script)

Thanks

javo-ru avatar Jan 11 '17 22:01 javo-ru