Accept view-source: protocol

RESOLVED FIXED

Status

Firefox OS
Gaia::Browser
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: David Bruant, Assigned: Takeshi Kurosawa)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

3 years ago
Bug I noticed in the ZTE Open C running FirefoxOS 1.3. No idea if this bug is fixed in later versions.

The view-source: protocol allows to see the source code of a web page. It's extremely useful on mobile to see, especially to try to diagnoze on someone else's phone why some website doesn't work (view source allows to see if a different website version was served based on UA sniffing for instance).
See for instance : view-source:https://www.mozilla.org/en-US/privacy/

On the ZTE Open C, typing view-source:(url) in the browser URL bar leads to a google search. It'd be nice if it showed the source code.

I imagine the protocol is part of core, so it's probably just a matter of making the feature accessible by default via the browser UI.
(Assignee)

Comment 1

3 years ago
Created attachment 8542859 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/27075
(Assignee)

Updated

3 years ago
Attachment #8542859 - Flags: review?(bfrancis)
Comment on attachment 8542859 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/27075

Looks good to me.

Tim, I hope you don't mind me forwarding this review to you. It isn't clear from https://wiki.mozilla.org/Modules/FirefoxOS whether this shared code falls under the Gaia component or the Shared component?
Attachment #8542859 - Flags: review?(timdream)
Attachment #8542859 - Flags: review?(bfrancis)
Attachment #8542859 - Flags: feedback+
Comment on attachment 8542859 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/27075

I would recommend look at |git blame| :)
Attachment #8542859 - Flags: review?(timdream) → review?(kgrandon)
Comment on attachment 8542859 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/27075

I believe I just copy/pasted the old implementation from browser, but since we do have a shared/ module now, I'll take a look.

Takeshi - this generally looks good to me, but I left one question on Github. Could you address the comment and re-flag me for review? Thanks!
Flags: needinfo?(taken.spc)
Attachment #8542859 - Flags: review?(kgrandon)
(Assignee)

Comment 5

3 years ago
Thank you for your reviews.

I updated the codes and tests.
https://github.com/takenspc/gaia/commit/2b2de3ad6d4029473ff25fc4e7ae3414afd3e1e8

However I updated the branch in wrong way. I will create new PR tomorrow. Sorry for the inconvenience.
Flags: needinfo?(taken.spc)
(Assignee)

Comment 6

3 years ago
Created attachment 8545904 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/27244

I created new PR though I lost the old PR (sorry for the inconvenience).
The new PR contains one aggregated commit.
Attachment #8542859 - Attachment is obsolete: true
Attachment #8545904 - Flags: review?(kgrandon)
Comment on attachment 8545904 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/27244

I'm happy with the changes, thanks!
Attachment #8545904 - Flags: review?(kgrandon) → review+
In master: https://github.com/mozilla-b2g/gaia/commit/008417477c649b46dbb97aedc2741a5d4c8e37ac
Assignee: nobody → taken.spc
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED

Comment 9

3 years ago
This has busted gaia lint on b2g-inbound https://treeherder.mozilla.org/logviewer.html#?job_id=1125559&repo=b2g-inbound
(In reply to nigelbabu@gmail.com [:nigelb] from comment #9)
> This has busted gaia lint on b2g-inbound
> https://treeherder.mozilla.org/logviewer.html#?job_id=1125559&repo=b2g-
> inbound

Argh, sorry about that. Backed out: https://github.com/mozilla-b2g/gaia/commit/d102cc0a7a1f346531553bec64588eea9e4594eb
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Takeshi - are you able to submit a new pull request with the JSLint issues fixed? I think we just need to break that line up so it's not longer than 80 characters. Sorry about missing it the first time.
Flags: needinfo?(taken.spc)
(Assignee)

Comment 12

3 years ago
Created attachment 8546598 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/27279

Sorry for bustage. I ensured |make lint| reports 0 errors this time.
Attachment #8545904 - Attachment is obsolete: true
Flags: needinfo?(taken.spc)
Attachment #8546598 - Flags: review?(kgrandon)
Comment on attachment 8546598 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/27279

Let's try this again - gaia-try is looking better this time. Thanks!
Attachment #8546598 - Flags: review?(kgrandon) → review+
In master: https://github.com/mozilla-b2g/gaia/commit/60b1002a771e289f2dd4195908973a0f5f65ab20
Status: REOPENED → RESOLVED
Last Resolved: 3 years ago3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.