Need help with porting my userscript (<- clueless)

I've never used git outside of making simple repos for userstyles and commenting on issues, no idea what I am doing right now.

What I did so far is

  • Made a fork of the repo
  • Added my userscript to /mods and manifest.json in the testing branch

I tested it and everything works fine. Is this enough? Am I just supposed to make a PR with these 2 commits now?? (o_o;;)

minnieo,
minnieo avatar

glad you got it working! i am the same way, very new to JS and never even touched github my whole life ( ̄▽ ̄)" it was quite a ride trying to figure out how to incorporate my script into KES. i winged it, looked at what others did, and somehow it worked. it was fun to figure out tho :D

artillect,
artillect avatar

If it's all working properly now, you can make a PR to the testing branch and we'll take a look at it so @shazbot can merge it into the repository

blobcat,
blobcat avatar

Okay. There's one last question, the way the notification button is added (always be next to the profile button) requires the :has() selector, it's enabled by default on Chromium browser but Firefox users need to enable it manually. Normally, if you don't have it enabled, the userscript shows a banner at the top telling you it doesn't work until you do it, should I remove it and add the requirement to the description instead or can it stay?

artillect,
artillect avatar

I think this should work for inserting the button:

const siblingElement = document.querySelector('.dropdown .login').parentElement;

I'm not sure how to get rid of the :has() selector at the end of the CSS though. If you aren't able to swap them both out for an alternate method, I think leaving the banner in is fine for now

blobcat,
blobcat avatar

Replaced it and it works, the :has() at the end of the css isn't important and is purely cosmetic so it can stay there for people with chromium and firefox users that have it enabled

shazbot,

Hey, I pushed a few commits into your PR to keep it up to date with some untracked changes. I tested out the panel and it functions as expected, I think. Can you update your copy of KES from the testing branch and check out if it looks and feels correct? I noticed there is a pause while it crams all of the page into the notifications panel and then updates it, not sure if this is consistent with the old script.

blobcat,
blobcat avatar

Sorry, my main browser suddenly broke (probably from some update) so I can't access tampermonkey in it. I tried to test it on Firefox but I can't get it to work for some reason (i'm probably doing something wrong tbh lol). But yes, the old script shows all of the page for a moment and then updates it, normally it would be slower during the first time, but faster after the next (in current tab).

shazbot,

I did some stress tests today on all extension types and Firefox/Chromium and everything was working. I am thinking about the behavior of the mod and made a ticket for it. I think in the future, it may be possible to fetch the remote contents asynchronously and load just those elements, instead of having to set up the whole page in an iframe.

blobcat,
blobcat avatar

Definitely, but that's going to be so much more work so it's probably still far from it.

shazbot,

Yes, that would be quite fancy. I agree with you that "perfect is the enemy of good," that tends to be my approach as well.

shazbot,

I'd personally look into using an alternate method than :has(), since it's not fully supported.

blobcat,
blobcat avatar

I tried but my knowledge is limited and I kept running into issues. Not waiting for Mozilla to move it out of about:config, it's been a year at this point and it's still not here for whatever reason.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • enhancement
  • rosin
  • Backrooms
  • InstantRegret
  • magazineikmin
  • khanakhh
  • hgfsjryuu7
  • Youngstown
  • slotface
  • osvaldo12
  • everett
  • thenastyranch
  • kavyap
  • Durango
  • DreamBathrooms
  • provamag3
  • tester
  • mdbf
  • modclub
  • cubers
  • tacticalgear
  • ngwrru68w68
  • ethstaker
  • Leos
  • normalnudes
  • cisconetworking
  • GTA5RPClips
  • anitta
  • JUstTest
  • All magazines