Skip to content

Instantly share code, notes, and snippets.

@volkanunsal
Last active November 22, 2025 17:33
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 2025-11-22:5
// @description Open NotebookLM notebooks in a new tab via right-click context menu.
// @author Volkan Unsal
// @downloadURL https://gist.githubusercontent.com/volkanunsal/4320f9f7ad54733b75f6f7995adff83c/raw/open-notebook-in-new-tab.user.js
// @updateURL https://gist.githubusercontent.com/volkanunsal/4320f9f7ad54733b75f6f7995adff83c/raw/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"}getTimestamp(){let e=new Date;return this.timestampFormat==="ISO"?e.toISOString():e.toLocaleString()}formatMessage(e,...t){let r=[this.prefix];return this.timestamp&&r.push(`[${this.getTimestamp()}]`),r.push(`[${e.toUpperCase()}]`),[r.join(" "),...t]}debug(...e){this.enabled&&console.debug(...this.formatMessage("debug",...e))}info(...e){this.enabled&&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&&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 f(o={}){return new i(o)}(function(){"use strict";let o=f({prefix:"[OpenNotebookInNewTab]",namespace:"UserScript"}),e={SELECTORS:{PROJECT_BUTTON:".my-projects-container project-button",PROJECT_BUTTON_BOX:".project-button-box"}};({interceptContextMenu(){document.addEventListener("contextmenu",r=>{let n=r.target?.closest(e.SELECTORS.PROJECT_BUTTON);if(o.log("Right-click detected on:",n),n){r.preventDefault();let s=n.querySelector(e.SELECTORS.PROJECT_BUTTON_BOX);if(o.log("Project button box found:",s),s){let l=s.closest("mat-card");if(!l){o.log("No mat-card found for the button box.");return}let m=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,c=l.getAttribute("aria-labelledby"),a=c?.match(m)?.[0];o.log("Labelers attribute:",c),o.log("Extracted notebook ID:",a),a&&GM_openInTab(`https://notebooklm.google.com/notebook/${a}`)}}})}}).interceptContextMenu()})();})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment