# Links

Click the following links to install menus popped by long pressing the bookmark button (with star as icon):
Capture long screenshot (need long screenshot mode)

Select All:CTRL-A/undo:CTRL-Z/Redo:CTRL-Y
Extend site cookies to 10 years
Clear site cookies

VPN

Switch configuration

Wait for network msg

Certificate info

Backup to box.com

Restore from box.com

upload to box.com

More webdav link menu items

Web fullscreen

Long pressing the bookmark button in uweb browser will popup menus defined in file "default.link". The file format is as follows:
[Menu name]:[one or more links delimited by " \n "]

and each link has the following format:
[url][space][javascript code]

in which space and later parts are optional. url and later parts support "%u","%s" etc.. The javascript code will be executed after url is fully loaded.

url supports all standard scheme (http(s):,javascript: etc.) and uweb internal schemes ( ':' as second character in the url ) and special links that begins with ':'.

uweb browser will handle local file urls (file:///) specially for some file types：

- .js file(same as long pressing hypertext to execute js file): If the ".js" file begins with "//", then uweb browser will load the site following "//" and execute the following js code.

If the above mentioned [links] part is malformated, then it is auto detected as html or text.

default.gesture and default.button have the exactly same file format. ".gesture" files define gestures while ".button" define bottom toolbar button pressing actions from the last button to the first.

proxy config:
httpproxy::010[proxy host]:[port]
socks5::011[socks host]:[port]
noproxy::010:

### special links beginning with ':'

- :0003
  Toggle fullscreen mode

- :0004
  Rotate the screen

- :001[fileurl]
  Scan the fileurl and add it to media storage

- :010[proxy host]:[port]
  Config http proxy, ":010:" to disable any proxy.

- :011[socks host]:[port]
  Socks proxy

- :0cc[url1]:[url2][:;[cookie attributes]]
  cookie copy from url1 to url2, the last part "[:;[cookie attributes]]" is optionable.

#### commands

- :![command line]
  The command line could be a ".js", ".sh" or other executable with arguments. Ex. ":!s g keyword" could invoke "s.js" executable with the whole string as arguments ("s.sh" or "s" if file exists, here "g" as google search engine); ":! g keyword" would invoke the file ".js" or ".sh" as executable.

  For regular (non-js) executables, the standard output of the command line will be treated as lines of web urls.

  Click to install the example file "s.sh"
  Click to install the example file ".js"

- :c[command]

  - close
    ":cclose" to close the current window/tab.
  - profile [parent folder] [file/folder] [optional ID]
    Ex. ":cprofile . files" to switch configurations

- :p [width in milliInch]x[height] [top margin]:[right margin]:[bottom margin]:[left margin]
  Generate/Print PDF file in the "/sdcard/Download" folder, all units are milliinch.
  Ex. ":p x" or ":px" for screen width and infinite height (as long vector screenshot).
  ":p x[height]" or ":px[height]" for screen width.

### "i:" internal links:

- i:0b[path]:[url]
  Extract remote content (tar/tgz/zip) under the folder [path]. If [path] ends with "/", then put unzipped file under the folder "[path]/[file name stem]" (for zipped files only, not for tar/tgz).

- i:0m[bookmarklet index|prefix|?postfix|/.../localfile|H[headers]|c[cssFlag]]:[url]
  Visiting url and execute the uweb browser internal bookmarklet that keeps valid for all urls under the path of [url].

  - [bookmarklet index] must have two/three digits. The first two digits are used as index of bootmarklet. For example, "00" as the first local bookmarklet; "01" as the first remote script; then "02" as the second local bookmarklet, ... The third digit is uplevel, 1 to make bookmarklet valid for parent path of [url].
  - c[cssFlag]: For example, "c12" will apply the third and fourth global CSS (12=2^2+2^3).
  - H[headers]: Ex. "HX-Forwarded-For;8.8.8.8" adds extra http request header "X-Forwarded-For:8.8.8.8".
  - [?postfix]: the real visited url is "[url]+[?postfix]".
  - [/.../localfile]: load the local html/js file that processes [url]. The first character of the local html file must be "<".
  - All other cases will be treated as [prefix], the real visited url is "[prefix]+[url]".
  - Since activated scripts use internal mechanism of "i:0m" urls, the script itself cannot have 'H', '?' as its very first character.

- i:15[string]
  Set address bar text to be [string].

- i:16[mimetype]:[Action Name]:[App Name]:[Activity Name]
  Use third party app as input

- i:18[extended mimetype]:[range]:[url]
  Read partial data from url.
  <range>: the format is same as related http header, such as "500-1000,-300".
  <extended mimetype>: standard mimetype or mimetype followed by ".<filename>". In the later case, the file in uweb configuration folder will be appended to the fetched data.

- i:19[string]
  Append [string] to the address bar text.

- i:1c
  Show web certificate.

- i:1d<action>:<type>:<Category>:
  Launch app for specific <action>.

- i:1w
  Wait to receive url from the network and open the url.

- i:1w1
  Wait to receive url from the network and open the url (not showing ip)

- i:1e
  Open file manager for removable SDCARD download folder

- i:50[path]:[string]
  Save [string] as file

- i:51[path]:[url]
  Save [url] to ".autoc" file.

- i:52[path]:[url]
  Save bookmark.

- i:53[path]:[string]
  Save notes.

- i:54[path]:[url]
  Save as search engine.

- i:55[path]:[url]
  Save as link.

- i:56[string]
  Use [string] as user input on web page.
  The string can have any character such as ascii code 0-26, where code 0 means clear, and code 1-26 are from ctrl-A to ctrl-Z as shortcut keys. (to type "Ctrl-A" into a text file, use "Ctrl-Q Ctrl-A" with emacs or "Ctrl-V Ctrl-A" with vim)

- i:57[jscode]
  execute [jscode], even when js is disabled for the web page.

- i:58[url]
  Save to the desktop.

- i:5a[filename]
  Receive content from network to the file.

- i:5b[string]
  Copy [string] to the clipboard.

- i:5c[url]
  Change auto page turning internal url to be [url].

- i:5d[file url]
  Open the file url compatible to other browsers.

- i:5e[string]
  TTS

- i:5f[videourl]
  play video fullscreen. if videourl is empty, then make following requestFullscreen() work.

- i:5h[?postfix:|/regex/replacement:][url]
  force html for [url] visiting

  - [?postfix:] : the real url visited is "[url]+[?postfix]"
  - [/regex/replacement:]: execute regular expression replacement for the "[url]", then visit the resulting url.

- i:5i[url]
  Use the existing tab for the url with possible different url hash part.

- i:5j[string]
  if [string] is file url, then send the file/folder to network, otherwise send [string] to network.

- i:5p[videourl]
  play video in external player

- i:60[path]:[url]
  If existing local file, then open it or visit the [url].

- i:62[path]:[js code]
  Evaluate the [js code] and save the returned string to file.

- i:63[bookmarklet index]:[url]
  Visiting url and execute the bookmarklet. Only uweb predefined local bookmarlets are allowed.

- i:6i[js file path relative to configuration folder]:[url]
  Similar to i:5i, except executing the js file after possible url hash change.

- i:70[url]:[auto page turning url]
  Visiting [url], but use the second url as auto paging url.

- i:8d[url]
  Force downloading [url]

- i:8l[filename]
  Loading configuration [filename]. Ex. "i:8lconfig.html" to reload config.html.

- i:92[http request headers separated by ';']:[url]
  The "Host" Header (fake header, different from the standard) must be the first header.
  Ex. i:92Host;209.216.230.240:https://news.ycombinator.com
  use "i:0mi:92Host;209.216.230.240::https://news.ycombinator.com" to visit the site with specified IP address.

- i:b1[internal urls or javascript separated by "%0A"]
  Bundle of internal urls, if it is an "i:0" url, then it should have the following format:
  [title]%0A[msg]%0A[optional callback url%0A][i:0url].

Last Modified: 2 April 2024
add js function in README

    i:56 urls support CTRL_A to CTRL-Z