Skip to content

file://: icon click should lead to the file-access toggle when access is off #28

Description

@danilrwx

On a file:// page without "Allow access to file URLs" the extension does nothing, silently: the manifest matches file:///*.diff / file:///*.patch, but Chrome only injects the content script after the user flips the per-extension toggle in chrome://extensions — and nothing in the UI points there. The toggle cannot be enabled programmatically (browser-side security), so the fix is guidance, not permission.

Proposal

When the toolbar icon is clicked on a file:// URL and chrome.extension.isAllowedFileSchemeAccess() resolves to false, open chrome://extensions/?id=<extension id> in a new tab (allowed via chrome.tabs.create) so the toggle is right in front of the user. One check plus one branch in the existing icon-click handler in the background worker.

Firefox needs no change — file:// matches from the manifest work there without a toggle, and isAllowedFileSchemeAccess resolves true.

Notes

  • README ("Install" section) already tells users to enable the toggle; this issue is about the moment they skipped that line.
  • Keep the behaviour scoped to file:// tabs — on http(s) pages the icon keeps its current open-diff/back-to-request logic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions