gildas-lormeau/SingleFile

Unable to edit page on mzh.moegirl.org.cn, blank in annotation editor with `Content Security Policy` errors (but open success, saved with smaller size)

Opened this issue · 2 comments

Describe the bug

  • Unable to edit page on mzh.moegirl.org.cn, but it may be OK on other website.
  • In annotation editor, it has lots of console error like: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem:". Either the 'unsafe-inline' keyword, a hash ('sha256-l242OUtjusUMGZVX2kId1Cju50oEaNyqlG4aUhIjSZQ='), or a nonce ('nonce-...') is required to enable inline execution.
  • I found it may be related to the settings: NOT blocking javascript, saving as self-extracting ZIP (universal).

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://mzh.moegirl.org.cn/Phigros/%E6%9B%B2%E7%9B%AE%E5%88%97%E8%A1%A8
  2. Click context menu "Annotate and save the page..."
  3. When annotation editor was opened, the page displays content instantly after opening, but immediately turns blank.
  4. Save the page. I found the file size is smaller than saving directly.
  5. The page can be opened and displays correctly.

Expected behavior
Able to edit the page content. Actually at the beginning I want to remove the message popup on the top when not blocking javascript. (But I fail hiding the element on the page before saving.)

Screenshots

Environment

  • OS: Win11
  • Browser: Chrome 124.0.6367.158 / 360ChromeX 22.3.3015.64 core 122.0.6261.95
  • Version: SingleFile 1.22.47

Additional context
My settings:
singlefile-settings-2024-05-19T07_03_54.660Z.json

Actually, the problem is that the scripts in the page are not supported in the annotation editor. Moreover, I was unable to save the page properly (by clicking on the SingleFile button). You have to block scripts when saving this page.

Actually, the problem is that the scripts in the page are not supported in the annotation editor. Moreover, I was unable to save the page properly (by clicking on the SingleFile button). You have to block scripts when saving this page.

but I can save the page (by clicking on the SingleFile button or after using annotation editor), it's confuseing.