Skip to content
Georg Jähnig edited this page Nov 4, 2023 · 6 revisions

fill-and-submit

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 users

Requirements

Install

  1. In your browser, open https://www.trovu.net/userscripts/fill-and-submit.user.js
  2. There should be a dialog opening that offers to install the user script.
  3. Install and you are done.

For shortcut editors

Creating shortcut that use the userscript

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:

  1. calls the URL
  2. fills input field found with CSS selector #simpleSearchSearchForm:fpSearch with value from {%query}
  3. submits form with submit button selected by #simpleSearchSearchForm:commandSimpleFPSearch

Documentation:

  • serchilo[fill]: array containing selectors and values

    • serchilo[fill][selector1]=value1
    • serchilo[fill][selector2]=value2
    • ...
  • serchilo[submit]: string with selector of element to click on.

Notation: selector string must escape some chars:

  • : = \:
  • . = \.
  • # = %23

For developers

Requirements

Edit and install

  • Edit src/js/userscripts/fill-and-submit.js
  • npm run build-userscripts This will create fill-and-submit.user.js.
Clone this wiki locally