Using custom js/jq on any site/page
Page 1 of 1
Interinactive
VIP Member



Posts: 29477

PostPosted: Mon, 6th May 2013 06:10    Post subject: Using custom js/jq on any site/page
I've never built a plugin or dealt with this very much, so hopefully someone has

I can handle the jQuery/JS part of this, but I'm wondering how I can make certain selectors load on certain domains/pages and have changes applied.

Is there a simple way to do this?

I know there are CSS extensions that can modify things on a page, but not everything has a selector - for example, the amount of posts people have on this forum - which could be handled by finding a certain word, giving it a class, and setting that class to display: none;

There are a load of sites I could use this sort of thing for, so it'd be very helpful

Thanks for any ideas/help
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Mon, 6th May 2013 08:30    Post subject:
If you want you can pm me something more specific Smile


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Mon, 6th May 2013 11:54    Post subject:
If you just want the post numbers on the page:
Code:
$('.postdetails').each(function(){var q = $.trim($(this).contents().filter(function() { return this.nodeType == 3;}).eq(2).text().split(':')[1]); if ($.isNumeric(q)) console.log(q)});


This way you can get the postcounts for each post on the page, but tbh I am not really sure what you are aiming at. Loading the same js script from different pages/domains and have the same style? As you can see, this is a quite complex selector and you can't target textnodes with CSS so jQuery class attaching is pretty much mandatory for something like this.

If you build the pages yourself, why can't you wrap important stuff just with the right tags/classes?


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Interinactive
VIP Member



Posts: 29477

PostPosted: Mon, 6th May 2013 12:37    Post subject:
⁢⁢


Last edited by Interinactive on Tue, 5th Oct 2021 03:31; edited 1 time in total
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Mon, 6th May 2013 12:47    Post subject:
Ah sorry! So you meant an actual browser plugin (written in js/jq) for yourself that works on several sites and customize it for yourself! Smile


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Interinactive
VIP Member



Posts: 29477

PostPosted: Mon, 6th May 2013 12:58    Post subject:
⁢⁢


Last edited by Interinactive on Tue, 5th Oct 2021 03:31; edited 1 time in total
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Mon, 6th May 2013 13:01    Post subject:
ok, I'm at work right now and will see if I can build you a small plugin scaffold that you can extend with your own custom css/js/jq when I'm back at home this evening Smile


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Interinactive
VIP Member



Posts: 29477

PostPosted: Mon, 6th May 2013 13:03    Post subject:
⁢⁢


Last edited by Interinactive on Tue, 5th Oct 2021 03:31; edited 1 time in total
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Mon, 6th May 2013 13:44    Post subject:
The NFOHump Browser extension is open source, if you don't want to wait, why don't you take a look at it's source? It has everything, from the manifest (rights management etc, auto updating), to custom script execution Smile

http://www.nfohump.com/forum/viewtopic.php?t=75547

Warning: Read the TOS carefully! (Basically all your anus belongs to garus)


The crx file is a zip, so you can extract it (with f.e. 7zip) and take a look at everything and play around.


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group