[userscript] StartPage Domain Search For Security Page

General discussion about the NoScript extension for Firefox
Post Reply
Mad_Man_Moon
Senior Member
Posts: 82
Joined: Fri Oct 27, 2017 12:02 pm

[userscript] StartPage Domain Search For Security Page

Post by Mad_Man_Moon »

I have written a teeny-tiny thing so that I can easily get to a StartPage search for a given domain that I've queried in NS.

Hope that this is OK, will take it down if Giorgio / Barbaz object ! :)

However, with your permission, Giorgio / Barbaz I will make it public.

Either way, it is located under the following ID on GreasyFork, and is unlisted, there:

Code: Select all

541054
GreasyFork Link
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
barbaz
Senior Member
Posts: 11067
Joined: Sat Aug 03, 2013 5:45 pm

Re: [userscript] StartPage Domain Search For Security Page

Post by barbaz »

Mad_Man_Moon wrote: Sat Jun 28, 2025 3:36 pm Hope that this is OK,
It's absolutely OK. Thanks for posting! 👍

Looking at the code:

1) You might consider not using external dependencies for something this simple. Especially consider how you're using jQuery if https://palant.info/2020/03/02/psa-jque ... r-project/ is still the case.

2) Depending how "untrusted" the domain is, you might consider not inserting it directly into HTML by concatenation, and instead using:
- URL API and the associated URLSearchParams for inserting the domain in the Startpage search URL
- .textContent or document.createTextNode() to add the domain to the "Startpage Search about " text in your "li" element
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Mad_Man_Moon
Senior Member
Posts: 82
Joined: Fri Oct 27, 2017 12:02 pm

cheers!

Post by Mad_Man_Moon »

Very nice stuff, thanks for the studied advice!

My only unfortunate thing is that I took one look at those pages and didn't have a clue what was going on. :weary:

What I *would* be willing to do would be what my old methodology was and that was to just literally paste the entire minified jQuery code at the start of the script. However that is a little overkill, here.

Perhaps since I am not using the mutation observer stuff, I should switch it to the official jQuery link, rather than this specific one, and that might be more welcoming to those worried about some random link.

In fact, I have just done that in v.1.1. :-)

( if I get more time I will try to figure it all out in javascript, promise, but am really rather dumb dumb dumb )

Let me know if I can 'public' it, too. :)
barbaz wrote: Sat Jun 28, 2025 5:41 pm It's absolutely OK. Thanks for posting! 👍

Looking at the code:

1) You might consider not using external dependencies for something this simple. Especially consider how you're using jQuery if https://palant.info/2020/03/02/psa-jque ... r-project/ is still the case.

2) Depending how "untrusted" the domain is, you might consider not inserting it directly into HTML by concatenation, and instead using:
- URL API and the associated URLSearchParams for inserting the domain in the Startpage search URL
- .textContent or document.createTextNode() to add the domain to the "Startpage Search about " text in your "li" element
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Post Reply