Canvas Read-Only Copy

approved

by J

Copies selected text from read-only Obsidian Canvas cards. - This plugin has not been manually reviewed by Obsidian staff.

16 downloadsUpdated 4d agoGPL-3.0

Canvas Read-Only Copy

A small, standalone Obsidian plugin with one purpose: copy highlighted text from Markdown and text cards while a Canvas is in read-only mode.

Installation

  1. Close Obsidian.
  2. Create this folder inside your vault: <your-vault>/.obsidian/plugins/canvas-readonly-copy-fix/
  3. Copy main.js and manifest.json into that folder.
  4. Open Obsidian.
  5. Go to Settings -> Community plugins and enable Canvas Read-Only Copy.

If an earlier version is already installed, replace its main.js and manifest.json, then restart Obsidian or reload the plugin.

Use

  1. Open a Canvas and switch it to read-only mode.
  2. Highlight text inside a Markdown or text card.
  3. Press the normal copy shortcut (Ctrl+C on Windows/Linux or Cmd+C on macOS).

Choose the copy format under Settings -> Canvas Read-Only Copy -> Copy format:

  • Markdown (with formatting) copies Markdown syntax such as **bold**. This is the default and also provides rich HTML to applications that support it.
  • Rendered text (plain) copies only the visible text, without syntax such as **, _, or backticks and without rich formatting.
  • Rendered text (rich formatting) copies visible text without Markdown syntax and embeds the rendered HTML so compatible applications retain bold, italics, links, lists, and similar formatting.

Copy actions outside the selected read-only Canvas retain Obsidian's normal clipboard behavior. Body-targeted copy events only use a selection from the active Canvas, and inputs, text areas, and other editable controls inside a Canvas retain their native copy behavior.

Compatibility and limitations

  • The plugin deliberately does nothing in Canvas edit mode.
  • Canvas views in separate Obsidian windows are supported. Per-window copy listeners are removed when their Canvas views close.
  • Cross-origin web-page cards are not supported because browser security blocks access to selections inside embedded external sites.
  • Obsidian does not expose Canvas read-only state through its public plugin API. This plugin uses the Canvas view's internal readonly flag and may need a small update if Obsidian changes that internal field.

Development

The plugin is intentionally distributed as a single hand-written main.js file. There is no build step and there are no runtime dependencies.

Run the dependency-free checks with:

node --check main.js
node --check plugin.test.js
node --unhandled-rejections=strict plugin.test.js

The checks cover all copy formats, clipboard event scoping across multiple Canvas views, native copy behavior for editable controls, read-only versus edit mode, and listener cleanup when Canvas documents close or reopen.

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.