Skip to content

Instantly share code, notes, and snippets.

@volkanunsal
Last active April 10, 2026 23:43
Show Gist options
  • Select an option

  • Save volkanunsal/4320f9f7ad54733b75f6f7995adff83c to your computer and use it in GitHub Desktop.

Select an option

Save volkanunsal/4320f9f7ad54733b75f6f7995adff83c to your computer and use it in GitHub Desktop.
A simple userscript that adds a button to open your NotebookLM notebook in a new tab for easier multitasking and navigation.

Open Notebook in New Tab - NotebookLM Hacks

Open in Tampermonkey

A simple userscript that adds a button to open your NotebookLM notebook in a new tab for easier multitasking and navigation.

Getting Started

🔧 Installation

  1. Install Tampermonkey browser extension
  2. Click on the "Raw" button of the script below.
  3. Visit notebooklm.google.com to see the magic! ✨
/* eslint-disable */
// @ts-nocheck
// ==UserScript==
// @name Open Notebook in New Tab
// @namespace https://github.com/volkanunsal
// @version 2026.0410.1942
// @description Open NotebookLM notebooks in a new tab via right-click context menu.
// @author Volkan Unsal
// @downloadURL https://gist.githubusercontent.com/volkanunsal/4320f9f7ad54733b75f6f7995adff83c/raw/1ed777ac1eb36679cdf172266109ed704822c31b/open-notebook-in-new-tab.user.js
// @updateURL https://gist.githubusercontent.com/volkanunsal/4320f9f7ad54733b75f6f7995adff83c/raw/1ed777ac1eb36679cdf172266109ed704822c31b/open-notebook-in-new-tab.user.js
// @match https://notebooklm.google.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant GM_openInTab
// ==/UserScript==
"use strict";(()=>{var i=class{constructor(e={}){this.namespace=e.namespace,this.prefix=[this.namespace,e.prefix].filter(Boolean).join(" "),this.enabled=e.enabled!==!1,this.timestamp=e.timestamp!==!1,this.timestampFormat=e.timestampFormat||"locale"}isVerbose(){try{return!!localStorage.getItem("VERBOSE_LOGGING")}catch{return!1}}getTimestamp(){let e=new Date;return this.timestampFormat==="ISO"?e.toISOString():e.toLocaleString()}formatMessage(e,...t){let o=[this.prefix];return this.timestamp&&o.push(`[${this.getTimestamp()}]`),o.push(`[${e.toUpperCase()}]`),[o.join(" "),...t]}debug(...e){!this.enabled||!this.isVerbose()||console.debug(...this.formatMessage("debug",...e))}info(...e){!this.enabled||!this.isVerbose()||console.info(...this.formatMessage("info",...e))}warn(...e){this.enabled&&console.warn(...this.formatMessage("warn",...e))}error(...e){this.enabled&&console.error(...this.formatMessage("error",...e))}log(...e){!this.enabled||!this.isVerbose()||console.log(...this.formatMessage("log",...e))}custom(e,...t){this.enabled&&console.log(...this.formatMessage(e,...t))}group(e,t){if(!this.enabled)return t();console.group(`${this.prefix} ${e}`);try{t()}finally{console.groupEnd()}}groupCollapsed(e,t){if(!this.enabled)return t();console.groupCollapsed(`${this.prefix} ${e}`);try{t()}finally{console.groupEnd()}}table(e,t){this.enabled&&(this.info("Table data:"),console.table(e,t))}time(e){this.enabled&&console.time(`${this.prefix} ${e}`)}timeEnd(e){this.enabled&&console.timeEnd(`${this.prefix} ${e}`)}timeLog(e){this.enabled&&console.timeLog(`${this.prefix} ${e}`)}enable(){this.enabled=!0}disable(){this.enabled=!1}setPrefix(e){this.prefix=e}};function c(r={}){return new i(r)}(function(){"use strict";let r=c({prefix:"[OpenNotebookInNewTab]",namespace:"UserScript"}),e={SELECTORS:{PROJECT_BUTTON:".my-projects-container project-button",PROJECT_BUTTON_BOX:".project-button-box"}};({interceptContextMenu(){document.addEventListener("contextmenu",o=>{let n=o.target?.closest(e.SELECTORS.PROJECT_BUTTON);if(r.log("Right-click detected on:",n),n){o.preventDefault();let a=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,l=n.querySelector('a[href*="/notebook/"]'),s=(l?.getAttribute("href")||"").match(a)?.[0];s||(s=(l?.getAttribute("aria-labelledby")||n.querySelector("[id^='project-']")?.getAttribute("id")||"").match(a)?.[0]),r.log("Extracted notebook ID:",s),s&&GM_openInTab(`https://notebooklm.google.com/notebook/${s}`)}})}}).interceptContextMenu()})();})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment