-
Notifications
You must be signed in to change notification settings - Fork 2
Userscripts
Georg Jähnig edited this page Nov 4, 2023
·
6 revisions
Userscript for auto-filling and submitting forms on target websites. This may help when queries cannot passed by URL. Then one can define inputs by their CSS selectors that shall be filled with URL-passed arguments once the destination website is loaded, and a form button that shall be clicked automatically by Javascript.
- for Firefox: Greasemonkey
- for Chrome: Tampermonkey
- In your browser, open https://www.trovu.net/userscripts/fill-and-submit.user.js
- There should be a dialog opening that offers to install the user script.
- Install and you are done.
The shortcut URL should look like this (linebreaks only for clarity):
https://patentscope.wipo.int/search/en/search.jsf#
serchilo[fill][%23simpleSearchSearchForm\:fpSearch]={%query}&
serchilo[submit]=%23simpleSearchSearchForm\:commandSimpleFPSearch
So to make use of the userscript, add a hash parameter (after a #
), called serchilo
. It must contain the properties [fill]
and [submit]
.
Given the example above, it:
- calls the URL
- fills input field found with CSS selector
#simpleSearchSearchForm:fpSearch
with value from{%query}
- submits form with submit button selected by
#simpleSearchSearchForm:commandSimpleFPSearch
-
serchilo[fill]
: array containing selectors and valuesserchilo[fill][selector1]=value1
serchilo[fill][selector2]=value2
...
-
serchilo[submit]
: string with selector of element to click on.
-
:
=\:
-
.
=\.
-
#
=%23
- Edit
src/js/userscripts/fill-and-submit.js
-
npm run build-userscripts
This will createfill-and-submit.user.js
.