Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome Ext issue is occuring. Seems to be related to posthog.capture() #1361

Closed
seanwessmith opened this issue Aug 15, 2024 · 2 comments
Closed

Comments

@seanwessmith
Copy link

seanwessmith commented Aug 15, 2024

Bug Description
Bug description
I've created a simple reproduction for this issue. You can find it here.

Since 1st of August, we started getting rejections from Chrome Store for our browser extension. The reason for these rejections is that remote code execution is not allowed in Manifest v3 extensions.

Some posthog features are using remote code execution via injecting a script tag:

session replays
surveys
autocapture
toolbar
Unfortunately, they are included in the bundle even if not used.

Here are the emails that we got from the Chrome Store:
image
image

How to reproduce
Clone the reporduction repo
Run pnpm i and then pnpm build
Open generated dist/content-scripts/main.js
Find 4 places with remote code execution (script tag injection) for:
/static/exception-autocapture.js
/static/surveys.js
/static/recorder.js
/static/toolbar.js
Additional context
This is not a bug, and I don't really know how this can be solved. Right now I've just forked the repo and removed all these features by hand.
Probably, the best way to enable them in the extensions would be to import the source code directly, instead of injecting script tags.

Debug info
No response

Chrome Ext issue is occuring. Seems to be related to posthog.capture()

import posthog from "posthog-js";
posthog.capture()

Code snippet: popup.js: loadScript("/static/recorder.js?v=".concat(ar.LIB_VERSION),
Code snippet: content_script.js: loadScript("/static/toolbar.js?t=".concat(s),
Code snippet: report.js: loadScript(this.instance.requestRouter.endpointFor("assets", "/static/exception-autocapture.js?v="

@seanwessmith
Copy link
Author

related issue on Posthog

#1394

@marandaneto
Copy link
Member

dupe #1394

@marandaneto marandaneto closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants