Page 1 of 1
[userscript] StartPage Domain Search For Security Page
Posted: Sat Jun 28, 2025 3:36 pm
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:
GreasyFork Link
Re: [userscript] StartPage Domain Search For Security Page
Posted: Sat Jun 28, 2025 5:41 pm
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
cheers!
Posted: Mon Jun 30, 2025 12:45 pm
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.
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