Skip to content

Programmatic drag-and-drop file upload into NotebookLM #9

Description

@GyaneshSamanta

Problem

Today, src/webview-preload.js listens for file-drop and logs file paths but does not actually trigger NotebookLM's upload pipeline. Constructing a synthetic file-drop DataTransfer event across the webview security boundary is not straightforward — File objects with real bytes are needed by NotebookLM's dropzone.

NotebookLM's native dropzone DOES accept drops, but only when the user drops directly onto NotebookLM's dropzone region — not when they drop anywhere on the window.

Proposed approach

A few options worth exploring:

  1. Read file → construct File via fetch: From the webview, fetch a file:// URL of the dropped path, build a File from the response Blob, dispatch a synthetic drop on NotebookLM's dropzone. Investigate whether webview security allows file:// reads.
  2. Auto-click NotebookLM's "+ Add source" + invoke <input type=file>: Locate the file input via DOM selectors and set its .files via DataTransfer. Selector stability is the risk.
  3. Forward to system clipboard + paste: Last-resort fallback for image files.

Files to touch

  • src/webview-preload.js — file-drop handler
  • src/renderer.js — pass file paths (already done)
  • src/main.js — may need a file-read helper exposed via IPC

Acceptance criteria

  • Dropping a PDF anywhere on the window produces the same outcome as dropping it on NotebookLM's dropzone.
  • Gracefully falls back to a "drop on the central area" toast if the upload fails.
  • Works for PDF, TXT, Markdown at minimum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:webviewEmbedded NotebookLM webview integrationbugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions