Last Comment Bug 200956 - Add ability for new tabs to load a custom page on creation. Implement "browser.newtab.url".
: Add ability for new tabs to load a custom page on creation. Implement "browse...
Status: NEW
:
Product: SeaMonkey
Classification: Client Software
Component: UI Design (show other bugs)
: Trunk
: All All
: -- enhancement with 1 vote (vote)
: ---
Assigned To: Ian Neal
: Paul Wyskoczka
Mentors:
: 202971 906352 (view as bug list)
Depends on: 197671
Blocks: 201177
  Show dependency treegraph
 
Reported: 2003-04-06 16:50 PDT by Ian Neal
Modified: 2016-03-06 17:04 PST (History)
12 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Ian Neal 2003-04-06 16:50:53 PDT
Once the fix to bug 197671 has been checked in, there will be a new preference
that determines if the page that loads, when a new tab is created, is a blank
one, the user's homepage or the last page visited.
There may be a need to add another option, that of a custom page.

The backend stuff should be fairly simple to do, it's just a matter of deciding
how friendly the pref UI should be. I'd suggest it should be similar to how the
homepage is set.
Comment 1 Matthias Versen [:Matti] 2003-04-22 17:38:59 PDT
*** Bug 202971 has been marked as a duplicate of this bug. ***
Comment 2 Ian Neal 2003-11-10 14:55:38 PST
Is this still a needed enhancement?
Comment 3 Sundar Balasubramanian 2003-11-10 16:30:57 PST
Yes - having a new tab open a copy of the current screen is a much helpful
option (Ctrl-N in other browsers, for example).
Comment 4 Ian Neal 2003-11-11 13:46:59 PST
That functionality is not what this bug is about and it does already exist - try
setting your open new tab preference to last page visited.
Comment 5 Sundar Balasubramanian 2003-11-11 14:04:12 PST
That's correct. It works. I didn't quite get how this bug is different then?
Comment 6 Ian Neal 2003-11-11 14:25:53 PST
Basically that a new tab could have it's own home page, one different to the
normal home page. It was discussed in the linked bug 197671 I think.
Comment 7 txGreg 2004-09-20 09:40:10 PDT
Just replying to some of the questions; in concurrence with Ian's reponse.  As a
user, I like having the convenience of a one-click home page (Google :) to
access quickly.  However, I use the command-line override to specify "about:"
for quicker startup.  I wish I could do something similar for new tabs.

My recommendation would be to add an option for a startup page that can be a
custom URL distinct from the homepage.  This custom address could then be used
just like the other options for startup, new window or new tab.  (Just adding
these comments to explain my vote)
Comment 8 Damian Shaw [Quan] 2008-06-19 05:02:35 PDT
Whoops, sorry, was going to make this bug as a duplicate of bug 269664 and hit the wrong options.

But this is left as new and that is a newer bug, I assume all work on this has died a long long time ago though?
Comment 9 Philip Chee 2012-06-03 11:13:06 PDT
Starting in Firefox 13, you can set the page that opens in a new tab by changing 'browser.newtab.url' in about:config.

See http://hg.mozilla.org/mozilla-central/rev/bb271ef702c6 for an example.
Firefox Bug 455553 - New Tab Page feature.

We might want to port parts of Bug 455553
Comment 10 fulmare90 2012-06-08 06:06:11 PDT
When I open a new tab with a custom page in firefox the url bar is filled.
I find it annoying since I use the url bar to directly search with web search engines.
Would be possible to start the new tab with an empty url bar?
Comment 11 fulmare90 2012-07-28 12:22:35 PDT
Today I noticed Aurora behave like I asked (thank you someone :))
Just if I open two new tab and switch from one to another the url bar is filled again
Comment 12 Philip Chee 2013-08-17 23:04:27 PDT
*** Bug 906352 has been marked as a duplicate of this bug. ***
Comment 13 patrickjdempsey 2014-05-27 21:41:58 PDT
It looks like the option browser.tabs.loadOnNewTab: -1 is also currently broken.  Fixing both at the same time appears to be pretty simple.  There are two different ways to go about adding newtab.url: The pref browser.tabs.loadOnNewTab:0 could be modified so that "0" routes to browser.newtab.url, with the default being "about:blank".  Or we could leave browser.tabs.loadOnNewTab:0 alone and add browser.tabs.loadOnNewTab:3 to route to browser.newtab.url.  

The former would be easier for users requiring only one preference change, the latter would be more semantically correct ("0" = "blank") and might evade search hijackers targeting Firefox's implementation, but would require more work for the user to hook-up.  The patch for the latter method looks like this:


chrome://navigator/content/navigator.js
function BrowserOpenTab()


1325: switch (tabPref)
    {
      default:
        uriToLoad = "about:blank";
        break;
+      case -1:
+        uriToLoad = GetStringPref("browser.throbber.url");
+        break;
      case 1:
        uriToLoad = GetLocalizedStringPref("browser.startup.homepage");
        break;
      case 2:
        uriToLoad = GetStringPref("browser.history.last_page_visited");
        break;
+      case 3:
+        uriToLoad = GetStringPref("browser.newtab.url");
+        break;
    }
Comment 14 patrickjdempsey 2014-05-28 00:02:45 PDT
In addition to changing navigator.js, the browser-prefs.js file in omni.jar/defaults/prefs/ would need to be updated:

272: // lets new tab/window load something different than first window
// -1 - use navigator startup preference
//  0 - loads blank page
//  1 - loads home page
//  2 - loads last page visited
+//  3 - loads browser.newtab.url page
pref("browser.tabs.loadOnNewTab", 0);
pref("browser.windows.loadOnNewWindow", 1);
+pref("browser.newtab.url", "about:blank");

Also, I'm not sure if browser.throbber.url is correct for browser.tabs.loadOnNewTab:-1 or if it is supposed to be startup.homepage_override_url?  If it is the second, then there would need to be some parsing to resolve it: "http://www.seamonkey-project.org/releases/seamonkey%VERSION%/"
Comment 15 patrickjdempsey 2014-05-28 00:20:28 PDT
And here is a method if -1 is supposed to use startup.homepage_override_url.... assuming that all localizations use the same format?:

1325: switch (tabPref)
      {
        default:
          uriToLoad = "about:blank";
          break;
+        case -1:
+          uriToLoad = GetLocalizedStringPref("startup.homepage_override_url");
+          uriToLoad = uriToLoad.replace(/\%VERSION\%/g, Services.appinfo.version);
+          break;
        case 1:
          uriToLoad = GetLocalizedStringPref("browser.startup.homepage");
          break;
        case 2:
          uriToLoad = GetStringPref("browser.history.last_page_visited");
          break;
+        case 3:
+          uriToLoad = GetStringPref("browser.newtab.url");
+          break;
      }

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