kite-project / hope

A new web experience for your B2G and Android devices.
8 stars 3 forks source link

`http://` should be automatically prepended when the URL is laking one #33

Closed etiennesegonzac closed 8 years ago

jonathanKingston commented 8 years ago

Can it try https first please?

On Mon, Feb 1, 2016 at 4:57 PM Etienne Segonzac notifications@github.com wrote:

— Reply to this email directly or view it on GitHub https://github.com/kite-project/hope/issues/33.

etiennesegonzac commented 8 years ago

Of course, but the patch will probably be a bit bigger and we'll need to listen the mozbrowsererror to adjust.

jonathanKingston commented 8 years ago

I'm happy to take a look at that side if no one is interested?

On Mon, Feb 1, 2016 at 5:12 PM Etienne Segonzac notifications@github.com wrote:

Of course, but the patch will probably be a bit bigger and we'll need to listen the mozbrowsererror to adjust.

— Reply to this email directly or view it on GitHub https://github.com/kite-project/hope/issues/33#issuecomment-178073623.

etiennesegonzac commented 8 years ago

All clear, feel free to take a crack at this one :)

jonathanKingston commented 8 years ago

@etiennesegonzac thanks do you know if there is a plan for a settings page at all? (Personally I would like to turn the fallback off or at least prompt etc)

etiennesegonzac commented 8 years ago

We don't have that detailed of the plan right now :) The goal is really just to enable basic browsing first then go from there.

jonathanKingston commented 8 years ago

I may have accidentally implemented search whilst doing this bug :stuck_out_tongue:

So currently it operates on urls that don't validate with the new URL(url) object:

However I'm slightly reluctant to just throw in the downgrade as all this happens on users typing in the URL for the time being. However the error event would fire for any failing URLs which would mean any failure in HTTPS would downgrade to HTTP which would be super bad in places where a nation state actor is an issue etc.

I can show you where I am so far for comments etc whilst I think through how to implement the downgrading safely.

jonathanKingston commented 8 years ago

@etiennesegonzac initial work here: https://github.com/jonathanKingston/hope/commit/230f6fc2a4ea9ee21b0bc80ce9be405f750b1991 going for dinner :smile: needs tests etc and lots of love.

jonathanKingston commented 8 years ago

@etiennesegonzac Long term I think something similar to the History API will be needed to be synthesized on top of each tab to provide robust url changes on when a user typed an address vs navigation. I didn't get chance to write tests but it mostly seems to be working: https://github.com/jonathanKingston/hope/commit/e84c8dad9fc1ba38bd7e7049f44d15ba378e788d

etiennesegonzac commented 8 years ago

@jonathanKingston looks really promising, and already a net win for our short term goal of "making basic browsing usable". Send the PR :)