![]() |
|
Bronze [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Coding (https://sinister.ly/Forum-Coding--71) +--- Thread: Bronze [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs (/Thread-Bronze-JS-PrefixSparkleRemover-Remove-Fancy-Particles-from-prefixs) |
[JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - miso - 04-19-2020 This script is similar to the UserSparkleRemover script, however, you will need to replace %rgb_value% with the actual rgb value down below: Update v1.0.1: Now keeps original prefix background color
Code: RGB Values:
rgb(51, 42, 13) // Gold Patch
rgb(51, 51, 51) // Silver Patch
rgb(41, 31, 15) // Bronze PatchScript (replace %rgb_value% with an RGB value above): Code: var x = document.getElementsByTagName("span"), i;
for (i = 0; i < x.length; i++) {
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") %rgb_value%') {
x[i].style.background = "%rgb_value%"
}
}RE: [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - Crimin4L - 04-22-2020 Another awesome thread; Thank you once again for this! Here is how to implement all of them if anyone is wondering or confused: PHP Code: // ==UserScript==
// @name PrefixSparkleRemover
// @namespace http://tampermonkey.net/
// @version 0.1
// @description PrefixSparkleRemover
// @author miso
// @match https://sinister.ly/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var x = document.getElementsByTagName("span"), i;
for (i = 0; i < x.length; i++) {
//gold
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") rgb(51, 42, 13)') {
x[i].style.background = "rgb(51, 42, 13)";
}
//silver
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") rgb(51, 51, 51)') {
x[i].style.background = "rgb(51, 51, 51)";
}
//bronze
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") rgb(41, 31, 15)') {
x[i].style.background = "rgb(41, 31, 15)";
}
}
})();
Also just wondering; why do you put it into a for loop, and not just the if statements? RE: [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - Drako - 04-22-2020 The script doesn't seem to be working at all. I tried using your script and Crimin4l's implementation. I'm using Tampermonkey with Firefox Nightly. Edit: It's working now. RE: [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - miso - 04-22-2020 (04-22-2020, 05:06 PM)Crimin4L Wrote: Another awesome thread; Thank you once again for this!i did not plan for users to use all 3, maybe like a "select" statement can be used to load the 3 of those, a loop can also be used, but it should just loads this script once, it doesn't need to repeat the code. (except if theres a prefix loaded after excuting the script) RE: [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - Drako - 04-22-2020 (04-22-2020, 05:36 PM)miso Wrote:(04-22-2020, 05:06 PM)Crimin4L Wrote: Another awesome thread; Thank you once again for this!i did not plan for users to use all 3, maybe like a "select" statement can be used to load the 3 of those, a loop can also be used, but it should just loads this script once, it doesn't need to repeat the code. (except if theres a prefix loaded after excuting the script) I already found a bug. If you open up your 'Recent Alerts' menu, the gif loads there. RE: [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - miso - 04-22-2020 (04-22-2020, 05:38 PM)Drako Wrote:It is not a prefix, check this thread UserSparkleRemover | Sinister.ly Thread(04-22-2020, 05:36 PM)miso Wrote:(04-22-2020, 05:06 PM)Crimin4L Wrote: Another awesome thread; Thank you once again for this!i did not plan for users to use all 3, maybe like a "select" statement can be used to load the 3 of those, a loop can also be used, but it should just loads this script once, it doesn't need to repeat the code. (except if theres a prefix loaded after excuting the script)
RE: [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - Crimin4L - 04-22-2020 (04-22-2020, 05:40 PM)miso Wrote:(04-22-2020, 05:38 PM)Drako Wrote:It is not a prefix, check this thread UserSparkleRemover | Sinister.ly Thread(04-22-2020, 05:36 PM)miso Wrote: i did not plan for users to use all 3, maybe like a "select" statement can be used to load the 3 of those, a loop can also be used, but it should just loads this script once, it doesn't need to repeat the code. (except if theres a prefix loaded after excuting the script) Even with the code from the UserSparkleRemover thread I still have the sparkle in my alerts also (I'm using both scripts)
RE: [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - miso - 04-22-2020 (04-22-2020, 07:06 PM)Crimin4L Wrote:thats weird :/, what browser do you use?(04-22-2020, 05:40 PM)miso Wrote:(04-22-2020, 05:38 PM)Drako Wrote: I already found a bug. If you open up your 'Recent Alerts' menu, the gif loads there.It is not a prefix, check this thread UserSparkleRemover | Sinister.ly Thread RE: [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - Crimin4L - 04-22-2020 (04-22-2020, 07:33 PM)miso Wrote:(04-22-2020, 07:06 PM)Crimin4L Wrote:thats weird :/, what browser do you use?(04-22-2020, 05:40 PM)miso Wrote: It is not a prefix, check this thread UserSparkleRemover | Sinister.ly Thread Brave Browser , also you never answered my question really before.why do you put the code into a for loop, and not just the if statements? Example: - Instead of this: PHP Code: (function() {
'use strict';
var x = document.getElementsByTagName("span"), i;
for (i = 0; i < x.length; i++) {
//gold
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") rgb(51, 42, 13)') {
x[i].style.background = "rgb(51, 42, 13)";
}
//silver
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") rgb(51, 51, 51)') {
x[i].style.background = "rgb(51, 51, 51)";
}
//bronze
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") rgb(41, 31, 15)') {
x[i].style.background = "rgb(41, 31, 15)";
}
}
})();
- Why not just this? PHP Code: (function() {
'use strict';
var x = document.getElementsByTagName("span"), i;
//gold
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") rgb(51, 42, 13)') {
x[i].style.background = "rgb(51, 42, 13)";
}
//silver
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") rgb(51, 51, 51)') {
x[i].style.background = "rgb(51, 51, 51)";
}
//bronze
if (x[i].style.background == 'url("images/groupimages/extra/sparkle.gif") rgb(41, 31, 15)') {
x[i].style.background = "rgb(41, 31, 15)";
}
})();
RE: [JS] PrefixSparkleRemover | Remove Fancy Particles from prefixs - miso - 04-23-2020 (04-22-2020, 11:33 PM)Crimin4L Wrote:oh, i putted it in a loop to check all span elements, then checks if the current element has the gif, then it removes it, removing the loop while affect only the 1st one(04-22-2020, 07:33 PM)miso Wrote:(04-22-2020, 07:06 PM)Crimin4L Wrote: Even with the code from the UserSparkleRemover thread I still have the sparkle in my alerts also (I'm using both scripts)thats weird :/, what browser do you use? btw i don't know how you got that glitch, i wasn't able to replicate it :/ |