Last Comment Bug 728313 - Bookmarklet fails on about:newtab
: Bookmarklet fails on about:newtab
Status: NEW
:
Product: Firefox
Classification: Client Software
Component: New Tab Page (show other bugs)
: unspecified
: x86 All
: -- normal with 25 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
: 739387 762626 776560 791407 (view as bug list)
Depends on: 776477 792532
Blocks: 723808
  Show dependency treegraph
 
Reported: 2012-02-17 10:49 PST by Boris Zbarsky [:bz] (still a bit busy)
Modified: 2016-03-18 00:37 PDT (History)
24 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
attempt #1 (1.86 KB, patch)
2012-02-23 11:20 PST, :Gavin Sharp [email: gavin@gavinsharp.com]
no flags Details | Diff | Splinter Review

Description Boris Zbarsky [:bz] (still a bit busy) 2012-02-17 10:49:16 PST
Build: anything with bug 723808 fixed.

Steps to reproducs:

1)  Follow instructions at http://lifehacker.com/240552/firefox-tip--how-to-set-up-multi+parameter-keyword-searches

2)  Hit Cmd-N

3)  Type in the bookmark keyword for the bookmark in step 1

ACTUAL RESULTS: JS doesn't run, since it has no principal to do so with

EXPECTED RESULTS: Make it work.

The problem is that about:newtab is system-principal, and we're trying to run the JS against it.

Perhaps we should consider replacing system-principal pages with about:blank before loading javascript: URIs?
Comment 1 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-02-17 13:25:30 PST
(In reply to Boris Zbarsky (:bz) from comment #0)
> Perhaps we should consider replacing system-principal pages with about:blank
> before loading javascript: URIs?

This would be ideal (for more than just this bug), but I was under the impression that it was kind of hard. Or did you mean a front-end fix?
Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2012-02-17 13:36:36 PST
Does just calling CreateAboutBlankContentViewer() not do the right thing?
Comment 3 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-02-23 11:20:43 PST
Created attachment 600103 [details] [diff] [review]
attempt #1

I'm not confident this patch is suitable to land, but it's a quick hack to test whether this approach would work. It doesn't seem to work (the new tab page stays loaded and the JS doesn't run), but I don't really know why.
Comment 4 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-06-25 10:20:51 PDT
*** Bug 739387 has been marked as a duplicate of this bug. ***
Comment 5 Jesse Ruderman 2012-07-15 04:03:21 PDT
*** Bug 762626 has been marked as a duplicate of this bug. ***
Comment 6 Jesse Ruderman 2012-07-15 04:10:52 PDT
> Perhaps we should consider replacing system-principal pages with about:blank before 
> loading javascript: URIs?

Another possibility would be to use disallowInheritPrincipal.  Then clicking a bookmarklet on about:newtab would be equivalent to typing a javascript: URL into the address bar (on any page).

Problem is, "location=" and "location.replace" don't seem to work with disallowInheritPrincipal.
Comment 7 Alice0775 White 2012-09-14 17:00:49 PDT
*** Bug 791407 has been marked as a duplicate of this bug. ***
Comment 8 Marco Bonardo [::mak] 2013-02-11 07:19:58 PST
*** Bug 776560 has been marked as a duplicate of this bug. ***
Comment 9 Bjorn Martensson 2014-01-08 21:51:32 PST
Workaround: Change the new tab page as described here https://support.mozilla.org/en-US/kb/new-tab-page-show-hide-and-customize-top-sites#w_how-do-i-turn-the-new-tab-page-off

Setting it to e.g. about:blank makes the bookmarklets work again. This is obviously only viable if you think it's acceptable to get a blank page when opening a new tab.
Comment 10 Matthew N. [:MattN] (In Taipei until Sep. 23) 2014-05-21 02:19:16 PDT
Mass-move to Firefox::New Tab Page.

Filter on new-tab-page-component.
Comment 11 Sandro Della Giustina 2015-07-15 05:30:39 PDT
Now that browser.newtab.url has been disabled, imo, this is a great annoiance.
Comment 12 Boris Zbarsky [:bz] (still a bit busy) 2015-07-15 09:15:28 PDT
You should probably just install https://addons.mozilla.org/en-US/firefox/addon/new-tab-override/ for now like I just did, pending bug 776477 getting fixed.
Comment 13 Sandro Della Giustina 2015-07-15 09:24:36 PDT
Thanks a lot Boris, this add-on is what I want, perfect :-)

Note You need to log in before you can comment on or make changes to this bug.