[Firefox Tip] Always Open “View Page Source” in a New Window Not Tab

If you open a website or webpage in Mozilla Firefox web browser and you decide to view page source, you can right-click on the web page and select “View Page Source” option from the context menu. You can also use Ctrl+U hotkey to open webpage source code. Firefox opens the webpage source code in a new tab in the same window.

This functionality was added long time back to Firefox 42.0 version and since then all Firefox versions always open web page source in a new tab.

Mozilla team also added a hidden preference or flag view_source.tab to Firefox’s advanced configuration page about:config in Firefox 42.0 version to modify or customize this behavior. Users were allowed to set the preference to False to restore the previous behavior and open web page source code in a new window rather than a new tab.

Advertisement

But later when Firefox 60.0 version was released, Mozilla team removed the view_source.tab preference and users could no longer change this behavior. Page sources started opening in new tabs and users were unable to change it to open in a new window. Mozilla team forced users to view webpage source in new tab.

The good news is that Mozilla team has re-added the view_source.tab preference to about:config page in Firefox 68.0 version which means now you can again decide whether Firefox should open web page source in a new tab or a new window. We told you about this change in UPDATE 134 in our exclusive Firefox Nightly Update topic when Firefox 68.0 version was under development and testing.

Many Firefox users prefer to open webpage source in a new window rather than a new tab in same window. Now you can force Firefox to always open webpage source in a new window.

If you are using new version of Firefox and want to customize whether Firefox should open webpage source in new tab or a new window, following steps will help you:

1. Open Mozilla Firefox and type about:config in the addressbar and press Enter. It’ll show you a warning message, click on “I accept the risk!” button. It’ll open Firefox’s hidden secret advanced configuration page i.e. about:config page.

2. Now type view_source in Search filter box and look for following preference in the window:

view_source.tab

Advertisement

The preference value is set to true by default, which means opening webpage source in new tab is enabled in Firefox browser.

3. To open webpage source in new window, double-click on view_source.tab preference and set it to false. Alternatively, you can right-click on the preference and select Toggle option.

Open_Firefox_Webpage_Source_New_Window.png

That’s it. Now open Firefox will start opening webpage source in new window.

PS: To restore the default functionality i.e. opening webpage source in new tab, set the value of above mentioned preference to true.

BONUS TIP:

You can also customize the default source code editor in Firefox. When you select view webpage source option, Firefox opens page source code in its built-in code editor. You can force Firefox to open webpage source code in your favorite text editor such as Notepad, etc. Just set the preference view_source.editor.external to true and set the preference view_source.editor.path to full path of your desired text editing program’s EXE file such as C:\Windows\Notepad.exe

Published in: Mozilla Firefox

About the author: Vishal Gupta (also known as VG) has been awarded with Microsoft MVP (Most Valuable Professional) award. He holds Masters degree in Computer Applications (MCA). He has written several tech articles for popular newspapers and magazines and has also appeared in tech shows on various TV channels.

Comments

NOTE: Older comments have been removed to reduce database overhead. Be the first one to start the discussion.

Leave a Comment

Your email address will not be published. Required fields are marked *

NOTE: Your comment may not appear immediately. It'll become visible once we approve it.