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
Just wanted to quickly report a problem that I have seen with certain websites which specify a CSP (Content Security Policy), such as GitHub avatar URLs. The inline styles for the canvas element are prevented to load because of the CSP directives. The inline styles are being added in addStyleElement():
The height="868" and width="32" attributes on the canvas, when not applied with the styles cause a large empty space at the top, which pushes other content down - in the GitHub avatar example, it appears as if the image is having trouble loading (really, it's just further down on the page, if the user scrolls):
Maybe the canvas can be hidden in other ways for websites specifying a CSP (or if there are other problems with the CSP, maybe the CSP could be overridden with a nonce from the extension, randomly generated on each page load)
The text was updated successfully, but these errors were encountered:
karlhorky
changed the title
Canvas interferes with image viewing when CSP specified
Canvas interferes with layout when CSP specified
Aug 20, 2023
hmmm, so that error looks unrelated the extension (you can follow the link / reveal source / in sidebar), but I think you might be on to something about the canvas styling
Hi @neaumusic, thanks again for this extension! 🙌
Just wanted to quickly report a problem that I have seen with certain websites which specify a CSP (Content Security Policy), such as GitHub avatar URLs. The inline styles for the canvas element are prevented to load because of the CSP directives. The inline styles are being added in
addStyleElement()
:selection-highlighter/src/chrome_extension/content_script/utils.ts
Lines 7 to 31 in d742eab
The
height="868"
andwidth="32"
attributes on thecanvas
, when not applied with the styles cause a large empty space at the top, which pushes other content down - in the GitHub avatar example, it appears as if the image is having trouble loading (really, it's just further down on the page, if the user scrolls):Demo URL: https://avatars.githubusercontent.com/u/3423750?v=4
Kapture.2023-08-20.at.11.04.03.mp4
Maybe the canvas can be hidden in other ways for websites specifying a CSP (or if there are other problems with the CSP, maybe the CSP could be overridden with a nonce from the extension, randomly generated on each page load)
The text was updated successfully, but these errors were encountered: