Open Bug 200956 Opened 22 years ago Updated 10 years ago

Add ability for new tabs to load a custom page on creation. Implement "browser.newtab.url".

Categories

(SeaMonkey :: UI Design, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

People

(Reporter: iannbugzilla, Assigned: iannbugzilla)

References

Details

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.
Blocks: 201177
*** Bug 202971 has been marked as a duplicate of this bug. ***
Is this still a needed enhancement?
Yes - having a new tab open a copy of the current screen is a much helpful option (Ctrl-N in other browsers, for example).
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.
That's correct. It works. I didn't quite get how this bug is different then?
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.
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)
Product: Core → Mozilla Application Suite
Assignee: iann_bugzilla → jag
QA Contact: pawyskoczka
Assignee: jag → iann_bugzilla
QA Contact: pawyskoczka
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?
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
Summary: Add ability for new tabs to load a custom page on creation → Add ability for new tabs to load a custom page on creation. Implement "browser.newtab.url".
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?
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
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; }
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%/"
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; }
You need to log in before you can comment on or make changes to this bug.