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

wrap injectScript call in try..catch, offer extension builds as PR artifacts #1520

Closed
wants to merge 2 commits into from

Conversation

phryneas
Copy link
Member

This might resolve #1519.

Also adding a "download build extension" comment to future PRs with this, which would make it easier to get quick user feedback.

@phryneas phryneas requested a review from a team as a code owner September 16, 2024 08:26
Copy link
Contributor

github-actions bot commented Sep 16, 2024

You can download the latest builds of the extension for this PR here:

Copy link

relativeci bot commented Sep 16, 2024

#876 Bundle Size — 1.51MiB (0%).

bd71905(current) vs a413e0b main#871(baseline)

Warning

Bundle contains 13 duplicate packages – View duplicate packages

Bundle metrics  no changes
                 Current
#876
     Baseline
#871
No change  Initial JS 1.47MiB 1.47MiB
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 5 5
No change  Assets 12 12
No change  Modules 1218 1218
No change  Duplicate Modules 45 45
No change  Duplicate Code 3.12% 3.12%
No change  Packages 183 183
No change  Duplicate Packages 10 10
Bundle size by type  no changes
                 Current
#876
     Baseline
#871
No change  JS 1.47MiB 1.47MiB
No change  IMG 35.85KiB 35.85KiB
No change  HTML 857B 857B
No change  Other 757B 757B

Bundle analysis reportBranch pr/try-injectionProject dashboard


Generated by RelativeCIDocumentationReport issue

@phryneas phryneas marked this pull request as draft September 16, 2024 09:02
Comment on lines +53 to +60
try {
injectScript(browser.runtime.getURL("hook.js"));
} catch (e) {
console.warn(
"Error occured while trying to initialize Apollo Client Devtools:",
e
);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work, as the error is triggered delayed when the script evaluates, not when it is inserted in DOM.

Also, listening for a securitypolicyviolation event allows me to read the details of the violation, but not to prevent it from crashing the whole page. I'm a bit out of ideas.

@phryneas phryneas closed this Sep 17, 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

Successfully merging this pull request may close these issues.

Extension in a default-src 'self' CSP environment causes page load to fail
1 participant