Closed Bug 1389829 Opened 7 years ago Closed 6 years ago

Add "View Source" button to menu

Categories

(Firefox for Android Graveyard :: General, enhancement)

All
Android
enhancement
Not set
normal

Tracking

(relnote-firefox 60+, firefox60 verified)

VERIFIED FIXED
Firefox 60
Tracking Status
relnote-firefox --- 60+
firefox60 --- verified

People

(Reporter: mismith, Assigned: JanH)

References

Details

Attachments

(4 files)

Firefox for Android already supports viewing the source of a page by prepending "view-source:" before a URL. It would be convenient to have a dedicated button for this in the "..." menu, perhaps under "Page".
Assignee: nobody → jh+bugzilla
Depends on: 1251854
Depends on: 1389945
Changing component to Theme and Visual Design
Component: General → Theme and Visual Design
OS: Unspecified → Android
Hardware: Unspecified → All
Depends on: 1392996
We've removed HTML context menu support in bug 1424252, so I guess I could just go ahead now and think about how to get the additional functionality provided by the context menu working later.
Component: Theme and Visual Design → General
Blocks: 1430235
Comment on attachment 8942502 [details]
Bug 1389829 - Part 2 - Make files needed for View Source available for Fennec.

https://reviewboard.mozilla.org/r/212746/#review218592
Attachment #8942502 - Flags: review?(esawin) → review+
Comment on attachment 8942503 [details]
Bug 1389829 - Part 3 - Handle "View Page Source" on the JS side.

https://reviewboard.mozilla.org/r/168062/#review218596

::: mobile/android/chrome/content/browser.js:1443
(Diff revision 1)
>    },
>  
> +  viewSourceForTab(aTab) {
> +    let browser = aTab.browser;
> +    let outerWindowID = browser.outerWindowID;
> +    let URL = browser.currentURI.spec;

url
Attachment #8942503 - Flags: review?(esawin) → review+
Comment on attachment 8942501 [details]
Bug 1389829 - Part 1 - Add "View Page Source" to the Page menu in the UI.

https://reviewboard.mozilla.org/r/168060/#review218694
Attachment #8942501 - Flags: review?(cnevinchen) → review+
Comment on attachment 8942504 [details]
Bug 1389829 - Part 4 - Add simple Robocop test for View Page Source.

https://reviewboard.mozilla.org/r/212756/#review218714
Attachment #8942504 - Flags: review?(cnevinchen) → review+
Bug 1424252 will probably have to be backed out again for the time being, which means that this'll be stuck on again on sorting out the context menu one way or other due to bug 1251854.
Depends on: 1424252
Comment on attachment 8942503 [details]
Bug 1389829 - Part 3 - Handle "View Page Source" on the JS side.

https://reviewboard.mozilla.org/r/168062/#review218596

> url

Hmm, actually ViewSourceUtils expect that paramter to be passed in upper case as "URL", so it's either URL straight from the start, or else let `args = { browser, outerWindowID, URL: url };`
Pushed by mozilla@buttercookie.de:
https://hg.mozilla.org/integration/autoland/rev/d9e0b22fd920
Part 1 - Add "View Page Source" to the Page menu in the UI. r=nechen
https://hg.mozilla.org/integration/autoland/rev/cfc307ae9cc7
Part 2 - Make files needed for View Source available for Fennec. r=esawin
https://hg.mozilla.org/integration/autoland/rev/641164104728
Part 3 - Handle "View Page Source" on the JS side. r=esawin
https://hg.mozilla.org/integration/autoland/rev/f5fe81e72056
Part 4 - Add simple Robocop test for View Page Source. r=nechen
Tested with Google Pixel (Android 8.0), HTC 10 (Android 7.0), Nexus 5 (Android 6.0.1) on latest Nightly build and "View Page Source" option is displayed in Page Menu. Tapping on it the page source is opened in new tab. Marking status:60 as verified.
thx!
very useful feature :)
Release Note Request (optional, but appreciated)
[Why is this notable]: New feature
[Affects Firefox for Android]: only
[Suggested wording]: Added view source option to page menu
[Links (documentation, blog post, etc)]: only this bug
relnote-firefox: --- → ?
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.