Have you ever clicked a link from social media or browsed to a website only to discover you’re unable to access the content because you’re using an ad blocker or another extension?
In this tech tip you will learn how to open a web page in Incognito Mode with a bookmarklet and access content without disabling your ad blocker or adding the site to a whitelist.
We will be leveraging a feature of Google Chrome called Incognito Mode to bypass these annoying content restrictions caused by extensions or conflicts with other software in the browser. Incognito mode was initially designed to help multiple users share the same web browser without interfering with the settings of others. When Google Chrome is run in Incognito Mode, it creates a separate Chrome browser instance that allows users to load a web page without saving temporary files or loading extensions. As a result, the ad block extension is automatically disabled.
If you have ever right-clicked on a link in Google Chrome, you may have observed the menu that appears which includes the option “Open link in incognito window”.
It is easy to use Incognito Mode if a link is visible and available to right-click on, but it is a bit more challenging to open a page in Incognito Mode once it is already loaded in the web browser. Many pages that use anti-adblock prevent visitors from clicking anywhere else on the page and there is no link to right-click on and open the site in Incognito Mode. This is where a bookmarklet becomes useful. A bookmarklet allows us to run JavaScript on an already loaded page. Among the many amazing things JavaScript can do, we use it to retrieve the web address URL of the currently loaded web page and output it as a link we can right-click on and then re-open the page in Incognito Mode!
The JavaScript for this bookmarklet is simple and fits on a few lines. It can actually be done in a short in-line statement but I’ve added a few features to make it a little easier to read. Please see the full code below:
Bookmarklet To Open Page In Incognito Mode
Here are two methods to add the Open Page In Incognito Mode bookmarklet in Google Chrome:
Method 1: Click & Drag Bookmarklet To Bookmark Bar
1. Display the bookmark bar in the browser. The steps for Google Chrome are: click the Settings icon (3 dots) > click the “Bookmarks” menu item > click “Show bookmarks Bar”
2. Click once, hold and drag the Incognito Mode bookmarklet below to your bookmark bar.
How to drag a bookmarklet to the bookmark bar
Method 2: Manually Add Bookmarklet To Bookmark Bar
1. Copy the Javascript code below by clicking the “Copy” button.
javascript:document.body.innerHTML=' %3Ch1%3ERight-click Link Below To Open In Incognito Window%3C/h1%3E %3Cimg src=%22https://www.technojudo.com/wp-content/uploads/2019/03/Right-click-For-Incognito.jpg%22 alt=%22Right-click Link For Incognito Window%22%3E%20%3Cbr%3E%20%3Cp%3E %3Ca href='+location.href+'%3E'+location.href+'%3C/a%3E%3C/p%3E%20 %3Cimg src=%22http://technoju.do/3MAhv%22%3E%20 %3Cp style=%22font-size:11px%22%3E© 2019 Paul Luckett, %3Ca href=%22http://technoju.do/4Nspl%22%3ETechnoJudo.com%3C/a%3E%3C/p%3E';
2. Verify the bookmark bar is enabled in the browser. The steps for Google Chrome are: click the Settings icon (3 dots) > click the “Bookmarks” menu item > click “Show bookmarks Bar”
3. Right-click on an empty area of the bookmark bar > Click “Add page”.
4. Add a short name for the bookmarklet in the Name field (replace any pre-existing data).
5. Paste the JavaScript code copied from step 1 in the “URL” field (replace any pre-existing data).
6. Click the “Save” button to save the bookmarklet.
Test Incognito Mode With A Bookmarklet
1. Browse to a website such as Business Insider.
2. Click the new Incognito Mode Bookmarklet on your bookmark bar.
TIP: If you opted to use the drag and drop method to add the bookmarklet, you may have noticed that we gave it a really short name that included a plus symbol “IM+” (“I” for Incognito and “M” for Mode). The plus sign “+” allows us to use the bookmarklet by typing it’s name “IM+” and selecting the Javascript that appears in the address bar. It even works from the Chrome browser on your mobile phone (if you are signed into Chrome on your desktop and have the same account setup for sync on your mobile device).
3. The bookmarklet will produce a link in a dialog similar to the screenshot below > Right-click the link and select “Open link in incognito window”
4. Done. Enjoy the ability to reopen any website in a Incognito Mode window in three easy clicks!