-
Notifications
You must be signed in to change notification settings - Fork 63
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
Includes remotely-hosted code, so cannot be used within a Chrome extension #1383
Comments
Update: this appears to be happening because Google made updates to their static analysis tools. They also found "remotely-hosted code" in a README that was mistakenly packed with a different extension I work on. That was obviously an error. It seems unlikely that they will allow the honeybadger library in any Chrome extension going forward, now that their tooling can detect that it is executing code they can't audit. For anyone else who runs into this issue, my workaround was to grab I don't know if it will work, but I'll find out in the next day or two! |
Hey @raindrift, thanks for submitting this issue and good catch on figuring out the updates on their static analysis tools!
The feedback form is an optional feature, not heavily used and only for the browser integration (note that honeybadger-io/js is an isomorphic package). That's probably why we are lazy-loading it. @joshuap do you know if there's any other reason for taking this approach?
I think the reason it was made like this is because a fetch with HTTP POST would be rejected due to CORS from Honeybadger's API server - but I'm not 100% sure, it's been some time since I worked on this.
Considering they found "remotely-hosted code" in a README file, maybe it would be better to remove this part of the code (instead of commenting out)? In any case, let us know how it goes and we'll see how to proceed moving forward! 🤔 |
No prob! fwiw, I think a number of companies will be running into this in the coming weeks. For example, mixpanel's library is also no longer compatible.
I think adding a <script> tag to the dom is often used as a fallback when fetch or xhr are blocked for some reason? But I have the impression that more recent browser features for blocking content make this workaround largely obsolete now. There could be some other reason, though. FWIW, you may be able to get around your CORS issue by setting If the issue is that you're trying to get around the page's content security policy, I'd be surprised if this trick works. But even so, your user controls the page and can presumably change the CSP at least in most cases? I guess you have to support a lot of different browsers, including older ones. If the script tag is working around an issue that still exists, I wonder if it would be super difficult to have a build for extensions, in addition to the
Commenting the code does seem to have worked, inasmuch as I got a second rejection for some different code that I had not yet commented. So I guess their tools can understand code comments at least. Specifically, I also removed the body of the It hasn't been accepted yet, but it also hasn't been automatically rejected. Fingers crossed. |
@raindrift I'm not exactly sure why we went for the script tags instead of accepting all origins on the server side; maybe this was a standard approach when it was first introduced. I will see how it works by trying your suggestions (thanks for the "legacy CORS" mode switch!). The chrome extension build is a possible approach which I already considered, I will look into that as well. In any case, please keep us posted on the status of your extension review, it will help us move in the right direction. |
Update: our extension was accepted! So removing all the script tag
insertion worked.
…On Tue, Aug 13, 2024 at 22:55 Pangratios Cosma ***@***.***> wrote:
@raindrift <https://github.com/raindrift> I'm not exactly sure why we
went for the script tags instead of accepting all origins on the server
side; maybe this was a standard approach when it was first introduced. I
will see how it works by trying your suggestions (thanks for the "legacy
CORS" mode switch!). The chrome extension build is a possible approach
which I already considered, I will look into that as well.
In any case, please keep us posted on the status of your extension review,
it will help us move in the right direction.
—
Reply to this email directly, view it on GitHub
<#1383 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADZ73FRHIHNGCUK6F444ADZRLWMRAVCNFSM6AAAAABMHTWPPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBXHEYTCMZRHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks keeping us updated. I will work on a solution asap! |
No, I don't recall at the moment. |
Hey @raindrift, we have published a build on our CDN that does not include the code which caused the rejection on Google Play Store. The build is available at this URL: https://js.honeybadger.io/v6.10/honeybadger.ext.min.js It'd be great if you could try it and let us know if it worked for you :) |
@subzero10 We had the same problem. In https://js.honeybadger.io/v6.10/honeybadger.ext.min.js, I still see a |
What are the steps to reproduce this issue?
What happens?
Extension is rejected after review. I received the following notice by email:
What were you expecting to happen?
Extension would be accepted, on account of not breaking the rules.
Any logs, error output, etc?
No
Any other comments?
It took a few extension versions for them to catch this issue. Because of this, I know that Honeybadger works great in our extension! I am hoping we don't have to stop using it. I know this library has worked fine with mv3 for years. The policy isn't new, but perhaps there have been recent updates to Google's code analysis tools?
I am installing the npm version and packaging with webpack, but the same issue exists in the minified js.
It seems like this would be solvable by:
fetch()
For the moment, I will try to work around this by forking the Honeybadger library and removing the feedback form entirely, since we aren't currently using it.
What versions are you using?
Operating System: osx
Package Name: honeybadger-js
Package Version: 6.9.3
Browser Version: Chrome 127.0.6533.89 / arm64
The text was updated successfully, but these errors were encountered: