You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds a settings page to request host permissions and dynamically
register content scripts, enabling self-hosted Overleaf support;
converts the popup to a React app and updates build/manifest.
>
> - **Extension Manifest/Permissions**:
> - Replace static `content_scripts` with dynamic registration via
`scripting` API; widen `web_accessible_resources` to `*://*/*`.
> - Add `optional_host_permissions: '*://*/*'`, new permissions
(`scripting`, `activeTab`), and `options_page` (`settings.html`).
> - Keep `host_permissions` for Overleaf; strip
`permissions_explanation` at build time.
> - **Background/Runtime**:
> - Add `requestHostPermission` handler and auto-register content
scripts when permissions are granted
(`registerContentScriptsIfPermitted`).
> - New `libs/permissions.ts` to (un)register content scripts for
granted origins.
> - Expose `requestHostPermission` in `intermediate.ts` and add handler
name in `constants`.
> - **Settings UI**:
> - New React-based settings (`public/settings.html`,
`views/extension-settings/...`) with Host Permission widget to request
and list granted origins (uses `chrome.permissions`).
> - **Popup**:
> - Replace static HTML with React popup (`public/popup.html`,
`views/extension-popup/...`) and guidance + link to settings.
> - **Build/Tooling**:
> - Vite configs and `package.json` scripts updated to build `settings`
and `popup` bundles.
> - Minor log added in `main.tsx`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
677ab6b. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: webapp/_webapp/package.json
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,13 @@
6
6
"scripts": {
7
7
"dev": "nodemon --watch src --ext ts,js,tsx,jsx,json --exec 'npm run build'",
8
8
"dev:chat": "vite dev --config vite.config.dev.ts",
9
-
"build": "tsc -b && npm run _build:default && npm run _build:background && npm run _build:intermediate",
9
+
"build": "tsc -b && npm run _build:default && npm run _build:background && npm run _build:intermediate && npm run _build:settings && npm run _build:popup",
10
10
"_build": "vite build",
11
11
"_build:default": "VITE_CONFIG=default npm run _build",
12
12
"_build:background": "VITE_CONFIG=background npm run _build",
13
13
"_build:intermediate": "VITE_CONFIG=intermediate npm run _build",
14
+
"_build:settings": "VITE_CONFIG=settings npm run _build",
15
+
"_build:popup": "VITE_CONFIG=popup npm run _build",
Copy file name to clipboardExpand all lines: webapp/_webapp/src/manifest.json
+5-14Lines changed: 5 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -11,29 +11,20 @@
11
11
"48": "images/logo-1024.png"
12
12
},
13
13
"host_permissions": ["*://*.overleaf.com/"],
14
-
"permissions": ["cookies", "storage"],
14
+
"optional_host_permissions": ["*://*/*"],
15
+
"permissions_explanation": "The optional_host_permissions pattern '*://*/*' allows the extension to request access to any website. This is necessary to support self-hosted Overleaf instances and similar use cases. Users will be prompted to grant access only when needed. Please review the extension documentation for details on security and privacy implications.",
0 commit comments