Closed Bug 1170011 Opened 9 years ago Closed 9 years ago

A view source tab shouldn't have a "View Page Source" option (or else holding down "Ctrl+U" spawns zillions of view-source:view-source:view-source:... tabs)

Categories

(Toolkit :: View Source, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: flod, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file)

Select View Source on a page, source opens in a new tab.

1) The context menu still has a "View Page Source" option, which probably shouldn't be there.

2) If you select "View Page Source", or press CTRL+U, you end up in a page that looks like a plain text file, without any syntax highlighting (even if the menu item is selected), and you can keep going inception-style.
I was about to file a new bug, but I think it's basically the same as this one.

My STR:
 1. Visit some site, e.g. https://www.mozilla.org/en-US/
 2. Press Ctrl+U to view-source. Hold these keys down for a second or two.

ACTUAL RESULTS: I first get a new tab at...
>  view-source:https://www.mozilla.org/en-US/
...and then suddenly, more new tabs start *rapidly* spawning, with these URLs:
> view-source:view-source:https://www.mozilla.org/en-US/
> view-source:view-source:view-source:https://www.mozilla.org/en-US/
> view-source:view-source:view-source:view-source:https://www.mozilla.org/en-US/
etc etc.

EXPECTED RESULTS: No rapidly-spawning view-source:view-source: tabs.
Summary: A view source tab shouldn't have a "View Page Source" option → A view source tab shouldn't have a "View Page Source" option (or else holding down "Ctrl+U" spawns zillions of view-source:view-source:view-source:... tabs)
ISTR mconley implemented this
(In reply to Dave Townsend [:mossop] from comment #2)
> ISTR mconley implemented this

I am the culprit I think. :)
This disables the View Source command on view-source documents in the
view-source-in-tab mode.
Attachment #8652070 - Flags: review?(jaws)
Comment on attachment 8652070 [details] [diff] [review]
Disable infinite recursion on the View Source command

Review of attachment 8652070 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/base/content/test/general/browser_viewSourceInTabOnViewSource.js
@@ +5,5 @@
> +                              ]}, resolve);
> +  });
> +});
> +
> +add_task(function* test_page() {

test_regular_page

@@ +6,5 @@
> +  });
> +});
> +
> +add_task(function* test_page() {
> +  function* test_on_browser(browser) {

test_expect_view_source_enabled

@@ +17,5 @@
> +    url: "http://example.com",
> +  }, test_on_browser);
> +});
> +
> +add_task(function* test_page() {

test_view_source_page

@@ +18,5 @@
> +  }, test_on_browser);
> +});
> +
> +add_task(function* test_page() {
> +  function* test_on_browser(browser) {

test_expect_view_source_disabled
Attachment #8652070 - Flags: review?(jaws) → review+
Backed out for more browser_viewSourceInTabOnViewSource.js failures. Please verify that this is green on Try before attempting to re-land again.
https://treeherder.mozilla.org/logviewer.html#?job_id=13324210&repo=mozilla-inbound

https://hg.mozilla.org/integration/mozilla-inbound/rev/b15e2623ea80
https://hg.mozilla.org/mozilla-central/rev/b4dcf5d8245e
Assignee: nobody → ehsan
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: