Skip to content

About

Bookmark pages in Microsoft Edge's built-in Adobe PDF viewer — named bookmarks, one-click navigation via CDP, persistent storage per PDF.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

PDF Bookmarker — Microsoft Edge Extension

Bookmark pages in Microsoft Edge's built-in PDF viewer. Add titled bookmarks, jump to any page instantly, drag the panel to reposition it, and have all bookmarks persist across sessions — without reloading the PDF.

Version Manifest Browser


Features

  • Named bookmarks — give each bookmark a meaningful title
  • One-click navigation — click a bookmark to jump straight to that page
  • Persistent storage — bookmarks are saved per PDF URL and survive browser restarts
  • Draggable panel — drag the toggle tab to any vertical position; works with mouse and touch
  • Per-PDF overview — the toolbar popup shows all PDFs you have bookmarked

Installation (Developer Mode)

  1. Open Edge and go to edge://extensions
  2. Enable Developer mode (toggle, top-right)
  3. Click Load unpacked
  4. Select the pdf-bookmarker/ folder
  5. The extension icon appears in your toolbar

Usage

  1. Open any .pdf file in Edge
  2. A bookmark tab appears on the right edge of the window — click it to open the panel
  3. Type a title, enter the page number, click Add
  4. Click any bookmark in the list to jump to that page
  5. Click ✕ next to a bookmark to delete it
  6. Drag the tab up or down to reposition it; the position is remembered

File Structure

pdf-bookmarker/
├── manifest.json       Extension manifest (Manifest V3)
├── background.js       Service worker — CDP page navigation + storage
├── content.js          Injects the bookmark sidebar into PDF pages
├── sidebar.css         Sidebar overlay styles
├── popup.html          Toolbar popup UI
├── popup.js            Popup logic
├── create_icons.py     Helper script used to generate the PNG icons
└── icons/
    ├── icon16.png
    ├── icon48.png
    └── icon128.png

How Page Navigation Works

Edge's Adobe-powered PDF viewer renders its toolbar inside a native <embed> element. This means the page-number field is completely invisible to JavaScript (querySelectorAll, shadow-DOM walks, and the CDP Accessibility tree all see nothing from the viewer). Standard window.location.hash tricks have no effect either.

Navigation is achieved via the Chrome DevTools Protocol (CDP) through the chrome.debugger API:

  1. Attach a debugger session to the PDF tab
  2. Check for PDFViewerApplication (handles the old PDF.js-based viewer)
  3. Use Input.dispatchMouseEvent to click the page-number field in the toolbar at its known coordinates (window.innerWidth / 2, 30), followed by Input.insertText and an Enter keystroke
  4. Detach the debugger immediately — the "Edge is being controlled" banner disappears right away
bookmark click
    └─▶ background.js (service worker)
            ├─ chrome.debugger.attach
            ├─ S1: PDFViewerApplication.page = N  (PDF.js viewer)
            └─ S2: mouse click + type + Enter      (Adobe viewer)
                    └─ chrome.debugger.detach

The brief "Edge is being controlled by an extension" banner during navigation is an unavoidable consequence of using the chrome.debugger API and disappears within a fraction of a second.


Permissions

Permission Why it's needed
storage Persist bookmarks per PDF URL
activeTab Read the current tab's URL to scope bookmarks
tabs Query tab IDs for CDP targeting
debugger Attach CDP to send mouse/keyboard events to the PDF viewer
windows (Reserved for future use)

Known Limitations

  • Adobe viewer only — tested against Edge's Adobe-powered PDF viewer (NewPDFReaderEnabled). The old PDF.js viewer is also supported via Strategy 1.
  • Manual page entry — the viewer does not expose the current page number to JavaScript, so page numbers must be entered manually when creating bookmarks.
  • edge:// internal URLs — PDFs served from edge:// internal pages are not supported; only http://, https://, and file:// URLs are matched.
  • Embedded PDFs — PDFs inside <iframe> elements on web pages are not supported.

Roadmap Ideas

  • Export / import bookmarks as JSON
  • Bookmark reordering (drag-and-drop within the list)
  • Search / filter bookmarks
  • Color labels for bookmarks
  • Auto-detect current page via MutationObserver on the toolbar

About

Bookmark pages in Microsoft Edge's built-in Adobe PDF viewer — named bookmarks, one-click navigation via CDP, persistent storage per PDF.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages