Greasy Fork is available in English.

Discussioni » Sviluppo

How to remove tag by tag content?

§
Pubblicato: 08/01/2015
Modificato: 08/01/2015

How to remove tag by tag content?

I was trying to make a script that will delete a widget social networking from all sites, but my script does not work.
Here's the code to be deleted:


§
Pubblicato: 08/01/2015

It really depends on what VK.Widgets.Group does. If it's adding stuff as children of vk_group, then all your script would need to do is

var junk = document.getElementById("vk_group");
junk.parentNode.removeChild(junk);
§
Pubblicato: 08/01/2015

This will work if run in a loop several times
I tried to use this script:

$(function() {
$('script').each(function() {
var curreScriptTagCode = $(this).html()
if (curreScriptTagCode.indexOf("vk_group") != -1) {
$(this).remove()
}
});
});

But for some reason it does not work

wOxxOmMod
§
Pubblicato: 09/01/2015

@anlima, if it's a userscript then it must have a metablock header where you add a reference for jQueery, something liek this // @require http://code.jquery.com/jquery-latest.js

Pubblica risposta

Accedi per pubblicare una risposta.