leoding86/webextension-pixiv-toolkit

Error in fanbox-cs.js when visiting fanbox.cc; page won't load

roachcord3 opened this issue · 3 comments

Describe the bug
Fanbox site does not load correctly when extension is enabled in Firefox. Instead, a red bar appears at the top saying that there was an error, and in general, the page is mostly blank, showing only the header and footer bars. An error in the console in content_scripts/fanbox-cs.js shows up.

Expected behavior
Well, I expected normal operation. I don't even use this extension for fanbox, I only use it on the main pixiv site. Today is how I learned that the extension does stuff on fanbox too.

Example work from Pixiv
The behavior is reproducible (for me) always at the home page: https://fanbox.cc

Screenshots
Here is what the page looks like after the error bar goes away automatically (I had a hard time catching the error bar since it disappears after only one or two seconds.) The rest of the page is just grey. Eventually you can scroll down to the footer though.

pixivFANBOX

Browser and Version (please complete the following information):
Firefox 97.0, on macOS 11.6.3. Pixiv Toolkit version is 5.5.1. This broke when the extension updated recently. I do not believe the changelog from 5.5.2 covers this issue, either.

Settings of extension

{"MangaPageNumberStartWithOne":false,"alwaysPack":false,"animationJsonFormat":1,"askDownloadSavedWork":true,"autoActivateDownloadPanel":true,"disableDownloadsShelf":false,"displayWorkTypeLabel":true,"downloadPackFiles":true,"downloadPanelPosition":"center","downloadPanelStyle":1,"downloadRelativeLocation":null,"downloadSaveAs":false,"downloadTasksWhenDownloadingImages":3,"enableExtTakeOverDownloads":true,"enableExtend":false,"enableExtension":true,"enablePackUgoiraFramesInfo":true,"enablePtkSearch":true,"enableSaveDownloadHistory":1,"enableSaveVisitHistory":true,"enableWhenUnderSeconds":1,"extendDuration":3,"featureKnown":false,"guideShowed":true,"illustrationCreateSubdirectory":0,"illustrationImageRenameFormat":"{id}_p{pageNum}","illustrationKeepPageNumber":true,"illustrationPageNumberLength":0,"illustrationPageNumberStartWithOne":false,"illustrationRelativeLocation":"","illustrationRenameFormat":"{title} - {author}","importantNoticeDisplayed":true,"language":"default","mangaImageRenameFormat":"","mangaPageNumberLength":0,"mangaPagesInChunk":99,"mangaRelativeLocation":"","mangaRenameFormat":"","maxDownloadRecords":10000,"maxHistoryItems":10000,"multipleDownloadsGapTime":150,"notSaveNSFWWorkInHistory":false,"novelIncludeDescription":false,"novelRelativeLocation":"","novelRenameFormat":"","pixivComicImageRenameFormat":"{episodeId}_{episodeTitle}_p{pageNum}","pixivComicPageNumberLength":0,"pixivComicPageNumberStartWithOne":false,"pixivComicRelativeLocation":"","pixivComicRenameFormat":"{episodeId}_{episodeTitle}","showPixivOmina":true,"showReloadInPopup":false,"showUpdateChangeLog":true,"statIllustDownloaded":781,"statMangaDownloaded":2,"statNovelDownloaded":0,"statUgoiraDownloaded":68,"ugoiraConvertTool":"default","ugoiraCustomFFmpegCommand":"","ugoiraQuanlity":1,"ugoiraRelativeLocation":"","ugoiraRenameFormat":"{id}_p0","version":"5.5.1","visitHistoryType":"list","workCoverSize":1}

Additional context
There is an error trace in the browser console, I did my best to paste it but it is formatted weirdly.

InvalidPageError: https://www.fanbox.cc/
    i moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    t moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    p moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    n moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    value moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    injectPage moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    mounted moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    mounted moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    VueJS 14
        Be
        Qt
        insert
        k
        zi
        _update
        r
        get
        pn
        mount
        $mount
        $mount
        _init
        Cn
    201 moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
[fanbox-cs.js:1:20091](moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js)
    injectPage moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    mounted moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    (Async: MutationCallback)
    mounted moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1
    VueJS 14
        Be
        Qt
        insert
        k
        zi
        _update
        r
        get
        pn
        mount
        $mount
        $mount
        _init
        Cn
    201 moz-extension://4a24f823-4286-8a48-9a50-a2505d69a8b4/content_scripts/fanbox-cs.js:1

Also, this error does not occur when not logged in to fanbox. Disabling other extensions did not help; the issue went away immediately upon disabling Pixiv Toolkit.

It seems the Firefox addon doesn't handle the overwritten response headers correctly. I need to find a workaround to make it work right.

Just patched the code. And I'll submit a version in few days.

New version has been submitted. You can download it in release page and install it manually.