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

Blacklist helper #9

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Blacklist helper #9

wants to merge 15 commits into from

Conversation

PetrK39
Copy link
Contributor

@PetrK39 PetrK39 commented Jun 5, 2023

Feel free to double-check it.
It works not as good as I expected with a few minutes of resource update delay but still better than copying in manually.
Ping me if docs need more explanation.

As the next step I would like to make some cleanup and then document all modules (maybe with some fancy 'jsdoc to md' github actions)

@Enchoseon
Copy link
Owner

As a heads up I'm going to be really delayed in responding for the next couple of weeks. Will check this as soon as I can.

README.md Outdated Show resolved Hide resolved
Co-authored-by: Encho <38841444+Enchoseon@users.noreply.github.com>
@Enchoseon
Copy link
Owner

First run on a fresh install in a new browser in Violentmonkey 2.14.0 on Firefox 114.0.1, got this error:

index.php:544:1
[GELO]: Current page type is gallery Gelbooru Overhaul.user.js:209:25
Uncaught TypeError: scope.blacklistItems is undefined
    buildEditWindow moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:2725
    registerEditWinow moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:2655
    setupManager moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:3088
    applyTweakAdvancedBlacklist moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:1931
    onUpdate moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:732
    onUpdate moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:732
    applyConfig moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:789
    applyConfig moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:788
    applyConfig moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:787
    main moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:3503
    onDOMReady moz-extension://77a38d0a-1ec2-4156-abd3-1911b458b984/ Gelbooru Overhaul.user.js#1:171
index.php:2725:13

Crashes the entire script.

Here's the snippet the error points to:

resources/gelbooru-overhaul.blacklistManager.js
221-            let nameList = document.createElement("datalist");
222-            nameList.setAttribute("id", "go-advBlacklistListNames");
223:            scope.blacklistItems.forEach(i => {

Still don't have time to look onto it properly, but posting this here for proper bookkeeping.

@PetrK39
Copy link
Contributor Author

PetrK39 commented Jun 14, 2023

Looks like 'scope' is undefined. I'll try replace it with my recent discovery 'this.func = this.func.bind(this) when I get my hands on the code.
But I'm actually working on cleaning up code from things like that in a separate branch anyway

fixed blacklistItems is undefined
fixed error on applying OrderEntriesByHitCount while manager is not set up
@PetrK39
Copy link
Contributor Author

PetrK39 commented Jun 15, 2023

I just forgot to declare 'blacklistItems' in the class. Actually I got a different error but I believe this should fix it.

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.

2 participants