Session Link Titles

approvedunreviewed

by kevin

Turn pasted URLs into titled Markdown links, with a browser-session fallback for sites that reject ordinary requests.

Updated todayMIT

Session Link Titles

简体中文

An independent desktop Obsidian plugin that turns pasted URLs into titled Markdown links. When ordinary HTTP fetching fails, selected sites can be loaded in Obsidian's core Web viewer using its existing browser session.

Status: alpha, version 0.2.0. Published in Obsidian Community Plugins. Requires Obsidian 1.15.0 or newer. No dependency on Named Links, Auto Link Title, or the earlier local fallback helper; their source files are not modified.

Releases · Report a bug

Features

  • Automatically title a single pasted URL or up to 20 URLs pasted together.
  • Paste a URL over selected text to link that text without fetching a title.
  • Commands to title the URL at the cursor, title selected plain URLs, inspect one URL, and clear the cache.
  • Read Open Graph, Twitter, and HTML titles; decode declared legacy encodings such as GBK.
  • Browser fallback is restricted to a configurable domain list. Defaults: zhihu.com, bilibili.com, b23.tv, including subdomains.
  • Reuse an already open matching Web viewer page before opening a temporary tab. Successful temporary tabs close; unsuccessful tabs remain for manual inspection/login.
  • Five-minute in-memory cache, request deduplication, serial browser loads, and bounded waits.
  • If a fetch fails or the plugin is disabled, restore the original URL. If you edit/delete a pending marker, its result is discarded; duplicate markers are not blindly replaced.

Fenced code blocks, frontmatter, common inline-code contexts, existing Markdown link targets, and plain-text paste are excluded from automatic conversion. Existing Markdown links are not batch-retitled. Drag-and-drop and mobile are outside this first release. Markdown context detection is conservative and does not implement every possible nested Markdown construct.

Install locally

Install from the Obsidian Community listing using Add to Obsidian, or search for Session Link Titles in Community Plugins. For manual installation, download main.js, manifest.json, and styles.css from the latest GitHub release, copy them into <vault>/.obsidian/plugins/session-link-titles/, then enable the plugin in Obsidian. No build tools are needed for this method.

To build from source:

  1. Install Node.js 24+ and run npm ci --ignore-scripts.
  2. Run npm test and npm run package.
  3. Copy main.js, manifest.json, and styles.css from the release directory into <vault>/.obsidian/plugins/session-link-titles/. Or use npm run install:local -- "ABSOLUTE_VAULT_PATH".
  4. In Obsidian, reload the community plugin list and enable Session Link Titles.
  5. Disable other automatic title plugins, including Named Links and the earlier Link Title Browser Fallback, to avoid competing paste handlers.
  6. To use browser fallback, separately enable the Web viewer core plugin. The plugin will not change security settings or enable the core plugin for you.

No user data or login session is included in the release. The installer only copies the three release files; it does not change the enabled-plugin list.

Usage

Paste https://example.com/ normally. A temporary fetching marker becomes [Example title](https://example.com/). Paste with Ctrl/Cmd+Shift+V to keep plain text. For URLs already in a note, use the plugin commands in the command palette. Only plain URLs are converted; existing Markdown links are left unchanged.

If a site asks for login or verification, complete it manually in the Web viewer tab and retry. Login and browser rendering may help, but cannot guarantee success against anti-bot protections. Normal HTTP timeout is 6 seconds; browser waiting is up to another 20 seconds, and browser requests are queued. These values are configurable.

Optional Bilibili cookie import (0.2.0)

Manual login in Web viewer remains the easiest path. If that is unavailable, enable Bilibili cookie import in plugin settings, choose your own JSON cookie export (an array or an object containing cookies) or Netscape cookies.txt, review the counts, then press Import into Web viewer. Export using a browser tool you trust; this plugin neither installs an extension nor reads your Chrome profile. Raw Cookie: headers are not accepted because they lack domain metadata.

Only bilibili.com and its subdomains are imported. Other domains and expired entries are skipped. Limits: 1 MiB, 200 records. Values are hidden, and the file is never copied into the vault. The source export contains account credentials: keep it outside notes, synced folders and Git.

Imported entries are converted to session cookies (no persistent expiry). The plugin attempts to remove them when disabled or unloaded; Clear imported cookies removes entries imported during the current plugin run. Imports can replace existing same-name cookies and clearing them can sign you out; prior values are not backed up or restored. Cleanup cannot be guaranteed after an app crash. The browser can subsequently issue its own cookies under its normal retention rules. Reload existing Bilibili pages before retrying a title. This option does not add cookies to ordinary HTTP requests, and login does not guarantee that site challenges will pass.

Cookie access uses the same internal desktop Web viewer partition as the core browser. Import fails closed if that interface is unavailable. Unit tests use fake values and do not establish real-account login compatibility on every desktop version.

Privacy and browser sessions

  • HTTP title fetching sends a request to the pasted/selected destination and any redirect targets. No third-party title service, telemetry, analytics, or remote backend is used.
  • Allowed fallback sites are loaded as real web pages. Their scripts, media, analytics and redirects may run just as in a browser, using the Web viewer's existing session. Do not add domains you do not want loaded in that session. A tab may briefly become visible while Obsidian creates it.
  • Normal title fetching reads only the page URL and title. Optional Bilibili cookie import reads only an export file explicitly chosen by you; it never reads browser cookie stores or copies Chrome profiles. Cookie values are passed to the Web viewer session and never saved in data.json, notes, logs or Git.
  • Successful URL/title pairs are cached only in memory (at most 200 entries). Settings contain domain preferences and timeouts, not browsing history.
  • Obsidian plugins are not sandboxed. The official Web viewer documentation notes that third-party plugins can access its cookies and recommends your primary browser for sensitive/password-protected tasks: https://help.obsidian.md/plugins/web-viewer.
  • requestUrl does not expose cancellation or streaming limits here. A timeout stops waiting but the underlying HTTP request may continue. Non-HTML or responses over 2 MiB are ignored after receipt, not prevented from downloading.

Compatibility and limitations

Browser integration is isolated in src/browser.ts. Obsidian does not currently expose a documented public Web viewer API; this alpha relies on its internal view type and webview element. A future Obsidian update may require changes. The community listing is published; this internal dependency and the network/session behavior remain disclosed here for users and reviewers. HTTP-only mode does not use those internal browser hooks.

The two motivating URLs are a Zhihu article and a Bilibili video. Their success in a particular session does not establish compatibility with all content on either site. Error/login title filtering is heuristic. Do not use this plugin to bypass access controls.

Local validation on Windows / Obsidian 1.15.0 (2026-11-27): title-at-cursor commands wrote correct Markdown for example.com, Zhihu article 655984589, and Bilibili video BV16Z421e7yb, with the previous title plugins disabled. The Bilibili cold load initially returned 412; retrying after its Web viewer page loaded succeeded. A cold browser load is therefore not guaranteed. The original 18 automated tests also exercise the paste handler and asynchronous editor updates in a simulated host.

Development

npm ci --ignore-scripts
npm run dev
npm test
npm run check
npm run package

src/cookies.ts validates imports and scopes session writes; src/cookie-modal.ts provides explicit file selection and the desktop session adapter. src/core.ts contains URL, Markdown and request-policy logic; src/http.ts handles HTML extraction; src/browser.ts encapsulates Web viewer integration; src/main.ts owns paste events and guarded editor updates. Tests cover request fallback policy, host boundaries, caching/expiry, cancellation, Markdown escaping and user-edit races. Browser/site behavior must additionally be checked inside Obsidian; unit tests do not simulate a real login.

CI runs tests/type checking/build and prepares downloadable build artifacts. It does not publish releases. To prepare a release, update package.json, manifest.json, and versions.json, then run npm run package.

Before public release

  • Test on a clean vault with the stated minimum app version and after application restart.
  • Review the internal Web viewer integration and disclose it in the community submission.
  • Check paste/undo behavior, disabled-plugin cleanup, failed logins and site challenges on supported desktop platforms.
  • Publish a GitHub release tagged exactly 0.2.0 (without v) containing main.js, manifest.json, styles.css.
  • Submit through Obsidian Community, using an Obsidian account linked to the repository owner's GitHub account. The current process uses the directory submission form, not a pull request to obsidian-releases: https://docs.obsidian.md/Plugins/Releasing/Submit%20your%20plugin.

Authentication and request headers

HTTP headers such as User-Agent, Accept and Referer can affect how a site handles requests, but cannot create an authenticated session or guarantee acceptance. Browser cache stores page resources; it is not a substitute for login cookies or tokens. Copying a complete Chrome profile is neither required nor implemented.

The supported approach is to sign in manually in Obsidian's Web viewer and let the page use that session normally. An optional Bilibili cookie import is also available; it does not extract cookies from browsers or export credentials. Projects such as BiliNote also offer explicitly authorized browser-extension/session workflows; those are separate integrations, not a feature of this plugin. Login cannot guarantee that every anti-bot check will pass.

License and origin

MIT, copyright 2026 xukaiming. This implementation was written independently after a local proof of concept connecting Named Links to Web viewer. It does not bundle or patch either title plugin. Thanks to the Obsidian plugin API, core Web viewer, and the link-title plugin ecosystem for the underlying interfaces and inspiration.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.