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

Invalid HTML on card: SecurityError: Failed to execute 'insertRule' on 'CSSStyleSheet': Cannot access StyleSheet to insertRule #113

Open
aalemayhu opened this issue Oct 31, 2020 · 6 comments
Assignees
Labels

Comments

@aalemayhu
Copy link

Hei there!

I downloaded the Incremental Reading add-on (v4103). I was trying to follow the instructions under the usage in the README file. I added a link but when I open up the deck I end up with the below error message.

Screenshot 2020-10-31 at 8 44 59 AM

I could reproduce this by

  1. Copy https://en.wikipedia.org/wiki/Incremental_reading
  2. Then paste it in after Alt+3.
  3. Open the deck

I am running Anki:

Version 2.1.36 (53a984ba)
Python 3.8.0 Qt 5.14.2 PyQt 5.14.2

On macOS v10.15.7 (19H2).

Thanks.

@uuuser-name
Copy link

I have exactly the same issue. Did you manage to fix it?

@aalemayhu
Copy link
Author

aalemayhu commented Dec 27, 2020 via email

@AlexRiina
Copy link

I think you can fix this issue by commenting out the javascript in the width.js file

// if (screen.width > {maxWidth}) {{
//     var styleSheet = document.styleSheets[0];
//     styleSheet.insertRule(
//         "div {{ width: {maxWidth}px; margin: 20px auto }}", 0
//     );
// }}

https://github.com/luoliyan/incremental-reading/blob/master/ir/web/width.js

@scarbajali
Copy link

scarbajali commented Jan 22, 2021

I think you can fix this issue by commenting out the javascript in the width.js file

// if (screen.width > {maxWidth}) {{
//     var styleSheet = document.styleSheets[0];
//     styleSheet.insertRule(
//         "div {{ width: {maxWidth}px; margin: 20px auto }}", 0
//     );
// }}

https://github.com/luoliyan/incremental-reading/blob/master/ir/web/width.js

This worked for me. Thanks!

@uuuser-name
Copy link

I think you can fix this issue by commenting out the javascript in the width.js file

// if (screen.width > {maxWidth}) {{
//     var styleSheet = document.styleSheets[0];
//     styleSheet.insertRule(
//         "div {{ width: {maxWidth}px; margin: 20px auto }}", 0
//     );
// }}

https://github.com/luoliyan/incremental-reading/blob/master/ir/web/width.js

It worked for me as well. Thanks a lot!

@jdlorimer jdlorimer self-assigned this Apr 22, 2021
@jdlorimer jdlorimer added the bug label Apr 22, 2021
@tvhong
Copy link
Collaborator

tvhong commented Oct 9, 2022

I'm trying it now and cannot reproduce.

My system info:

Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
Platform: Mac 11.6.2
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-10-09 10:19:20


===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Incremental Reading v4113 unofficial clone ['999215520', 2022-09-27T16:32, 'None', '']

===IDs of active AnkiWeb add-ons===
999215520

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants