5 <meta name=
"viewport" content=
"width=device-width, initial-scale=1" />
6 <link rel=
"canonical" href=
"https://jamesfengcao.gitlab.io/uweb/en/links/" />
8 <link rel=
"stylesheet" href=
"../style.css#" type=
"text/css" />
12 let href
= location
.href
;
13 for(let i
=href
.length
-1;i
>0;i
--){
14 if('/'==href
.charAt(i
) && '/'==href
.charAt(i
-3))
21 location
.href
= location
.href
.substring(0,i
+1)+page
;
23 function nav2Lang(lang
){
25 let href
= location
.href
;
26 location
.href
= location
.href
.substring(0,i
-2)+lang
+location
.href
.substring(i
);
31 <header class='header'
>
32 <a class=
"logo" href=
"javascript:void(0)" onclick=
"return nav2('index.html#')">Home
</a> <a class=
"logo" href=
"javascript:void(0)" onclick=
"return nav2('tags/index.html#')">Tags
</a>
35 <a class=
"logo" href=
"javascript:void(0)" onclick=
"return nav2Lang('zh')">简体中文
</a>
43 <div class=
"container">
44 <h1 class=
"title">Links
46 <span class=
"subtitle"></span>
51 <p>Click the following links to install menus popped by long pressing the bookmark button (with star as icon):
<br>
52 <a href=
"i:0gdefault.link::Input::cinput%0A">Select utf8 text file as keyboard input
</a></p>
53 <p><a href=
"i:0gdefault.link::Capture::ccapture%0A">Capture long screenshot
</a> (need
<a href=
"i:61:../searchurl/func.html">long screenshot mode
</a>)
</p>
54 <p><a href=
"i:0gdefault.link:../searchurl/txt/link.cfg">Select All:CTRL-A/undo:CTRL-Z/Redo:CTRL-Y
</a><br>
55 <a href=
"i:0gdefault.link::Extend cookies::0cc;Max-Age=315360000%0A">Extend site cookies to
10 years
</a><br>
56 <a href=
"i:0gdefault.link::Clear cookies::0cc;Max-Age=0%0A">Clear site cookies
</a></p>
57 <p><a href=
"i:0gdefault.link::vpn:i:1dandroid.net.vpn.SETTINGS:::%0A">VPN
</a></p>
58 <p><a href=
"i:0gdefault.link::profile_config::cprofile . files .conf%0A">Switch configuration
</a></p>
59 <p><a href=
"i:0gdefault.link::Wait msg:i:1w%0A">Wait for network msg
</a></p>
60 <p><a href=
"i:0gdefault.link::Certificate info:i:1c%0A">Certificate info
</a></p>
61 <p><a href=
"i:0gdefault.link::Backup2Box: {let path=`%f`;let iSlash=path.lastIndexOf('/',path.length-2);let f;if('/'!=path[path.length-1])f=path.substring(iSlash+1);else f=path.substring(iSlash+1,path.length-1);location.href='i:0e'+path+':https://dav.box.com/dav/'+f+'.tgz';}%0A">Backup to box.com
</a></p>
62 <p><a href=
"i:0gdefault.link::restoreFromBox: {let path=`%f`;let iSlash=path.lastIndexOf('/',path.length-2);let f;if('/'!=path[path.length-1])f=path.substring(iSlash+1);else f=path.substring(iSlash+1,path.length-1);location.href='i:0dhttps://dav.box.com/dav/'+f+'.tgz';}%0A">Restore from box.com
</a></p>
63 <p><a href=
"i:0gdefault.link::up2Box: {let path=`%f`;let iSlash=path.lastIndexOf('/',path.length-2);let f;if('/'!=path[path.length-1])f=path.substring(iSlash+1);else f=path.substring(iSlash+1,path.length-1)+'.tgz';location.href='i:0u'+path+':https://dav.box.com/dav/'+f;}%0A">upload to box.com
</a></p>
64 <p><a href=
"../searchurl/webdav.html">More webdav link menu items
</a></p>
65 <p><a href=
"i:0gdefault.link::web fullscreen: location.href='i:5fsetTimeout(()=>document.documentElement.requestFullscreen(),50);';%0A">Web fullscreen
</a></p>
66 <p>Long pressing the bookmark button in
<a href=
"../index.html#">uweb browser
</a> will popup menus defined in file
"default.link
". The file format is as follows:
<br>
67 [Menu name]:[one or more links delimited by
" \n
"]
</p>
68 <p>and each link has the following format:
<br>
69 [url][space][javascript code]
</p>
70 <p>in which space and later parts are optional. url and later parts support
<a href=
"../cmd/index.html#">"%u
",
"%s
" etc.
</a>. The javascript code will be executed after url is fully loaded.
</p>
71 <p>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 ':'.
</p>
72 <p>uweb browser will handle local file urls (file:///) specially for some file types:
</p>
74 <li>.js file(same as
<a href=
"../longclick/index.html#">long pressing hypertext to execute js file
</a>): If the
".js
" file begins with
"//
", then uweb browser will load the site following
"//
" and execute the following js code.
</li>
76 <p>If the above mentioned [links] part is malformated, then it is auto detected as html or text.
</p>
77 <p><a href=
"../gesture/index.html#">default.gesture
</a> 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.
</p>
79 httpproxy::
010[proxy host]:[port]:[username]:[password]
<br>
80 socks5::
011[socks host]:[port]:[username]:[password]
<br>
82 <h3 id=
"special-links-beginning-with-">special links beginning with ':'
</h3>
86 Toggle fullscreen mode
</p>
94 Scan the fileurl and add it to media storage
</p>
97 <p>:
010[proxy host]:[port]:[username]:[password]
<br>
98 Config http proxy,
":
010:
" to disable any proxy.
<br>
99 ":[username]:[password]
" is optional.
</p>
102 <p>:
011[socks host]:[port]:[username]:[password]
<br>
103 Socks proxy,
":[username]:[password]
" is optional.
</p>
106 <p>:
0cc[url1]:[url2][:;[cookie attributes]]
<br>
107 cookie copy from url1 to url2, the last part
"[:;[cookie attributes]]
" is optionable.
</p>
110 <h4 id=
"commands">commands
</h4>
113 <p>:![command line]
<br>
114 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.
</p>
115 <p>For regular (non-js) executables, the standard output of the command line will be treated as lines of web urls.
</p>
116 <p><a href=
"i:0hs.sh:../searchurl/txt/web.sh">Click to install the example file
"s.sh
"</a><br>
117 <a href=
"i:0h.js:../searchurl/txt/web.js">Click to install the example file
".js
"</a></p>
123 ":cclose
" to close the current window/tab.
</li>
125 ":cinput
" to select utf8 file as keyboard input
</li>
126 <li>profile [parent folder] [file/folder] [optional ID]
<br>
127 Ex.
":cprofile . files
" to switch configurations
</li>
128 <li>set [key] [value]
<br>
129 [key] could be one of the followings:
137 <p>:p [width in milliInch]x[height] [top margin]:[right margin]:[bottom margin]:[left margin]
<br>
138 Generate/Print PDF file in the
"/sdcard/Download
" folder, all units are milliinch.
<br>
139 Ex.
":p x
" or
":px
" for screen width and infinite height (as long vector screenshot).
<br>
140 ":p x[height]
" or
":px[height]
" for screen width.
</p>
143 <h3 id=
"i-internal-links">"i:
" internal links:
</h3>
146 <p>i:
0b[path]:[url]
<br>
147 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).
</p>
150 <p>i:
0m[-|
1-
9][bookmarklet index|prefix|?postfix|/.../localfile|H[headers]|c[cssFlag]]:[url]
<br>
151 Visiting url and execute the uweb browser internal bookmarklet that keeps valid for all urls under the parent path of [url].
</p>
153 <li>[-|
1-
9] is optional single character. '-' to limit bookmarklet work only for urls with same path (could be different query strings). The digit is uplevel,
1 to make bookmarklet valid for parent path of [url].
</li>
154 <li>[bookmarklet index] must have two digits. They 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, ...
</li>
155 <li>c[cssFlag]: For example,
"c12
" will apply the third and fourth global CSS (
12=
2^
2+
2^
3).
</li>
156 <li>H[headers]: Ex.
"HX-Forwarded-For;
8.8.8.8" adds extra http request header
"X-Forwarded-For:
8.8.8.8".
</li>
157 <li>[?postfix]: the real visited url is
"[url]+[?postfix]
".
</li>
158 <li>[/.../localfile]: load the local html/js file that processes [url]. The first character of the local html file must be
"<".
</li>
159 <li>All other cases will be treated as [prefix], the real visited url is
"[prefix]+[url]
".
</li>
160 <li>Since
<a href=
"../rjs/index.html#">activated scripts
</a> use internal mechanism of
"i:
0m
" urls, the script itself cannot have 'H', '?' as its very first character.
</li>
165 Set address bar text to be [string].
</p>
168 <p>i:
16[mimetype]:[Action Name]:[App Name]:[Activity Name]
<br>
169 Use third party app as input
</p>
172 <p>i:
18[extended mimetype]:[range]:[url]
<br>
173 Read partial data from url.
<br>
174 <range>: the format is same as related http header, such as
"500-
1000,-
300".
<br>
175 <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.
</p>
179 Append [string] to the address bar text.
</p>
183 Show web certificate.
</p>
186 <p>i:
1d
<action>:
<type>:
<Category>:
<data><br>
187 Launch app for specific
<action>.
</p>
191 Wait to receive url from the network and open the url.
</p>
195 Wait to receive url from the network and open the url (not showing ip)
</p>
199 Open file manager for removable SDCARD download folder
</p>
202 <p>i:
50[path]:[string]
<br>
203 Save [string] as file
</p>
206 <p>i:
51[path]:[url]
<br>
207 Save [url] to
".autoc
" file.
</p>
210 <p>i:
52[path]:[url]
<br>
214 <p>i:
53[path]:[string]
<br>
218 <p>i:
54[path]:[url]
<br>
219 Save as search engine.
</p>
222 <p>i:
55[path]:[url]
<br>
227 Use [string] as user input on web page.
<br>
228 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)
</p>
232 execute [jscode], even when js is disabled for the web page.
</p>
236 Save to the desktop.
</p>
239 <p>i:
5a[filename]
<br>
240 Receive content from network to the file.
</p>
244 Copy [string] to the clipboard.
</p>
248 Change auto page turning internal url to be [url].
</p>
251 <p>i:
5d[file url]
<br>
252 Open the file url compatible to other browsers.
</p>
259 <p>i:
5f[videourl]
<br>
260 play video fullscreen. if videourl is empty, then make following requestFullscreen() work.
</p>
263 <p>i:
5h[?postfix:|/regex/replacement:|encoding:][url]
<br>
264 force html for [url] visiting
</p>
266 <li>[?postfix:] : the real url visited is
"[url]+[?postfix]
"</li>
267 <li>[/regex/replacement:]: execute regular expression replacement for the
"[url]
", then visit the resulting url.
</li>
268 <li>[encoding:]: force web page encoding.
</li>
273 Use the existing tab for the url with possible different url hash part.
</p>
277 if [string] is file url, then send the file/folder to network, otherwise send [string] to network.
</p>
280 <p>i:
5p[videourl]
<br>
281 play video in external player
</p>
284 <p>i:
60[path]:[url]
<br>
285 If existing local file, then open it or visit the [url].
</p>
288 <p>i:
62[path]:[js code]
<br>
289 Evaluate the [js code] and save the returned string to file.
</p>
292 <p>i:
63[bookmarklet index]:[url]
<br>
293 Visiting url and execute the bookmarklet. Only uweb predefined local bookmarlets are allowed.
</p>
296 <p>i:
6i[js file path relative to configuration folder]:[url]
<br>
297 Similar to i:
5i, except executing the js file after possible url hash change.
</p>
300 <p>i:
70[url]:[auto page turning url]
<br>
301 Visiting [url], but use the second url as auto paging url.
</p>
305 Force downloading [url]
</p>
308 <p>i:
8l[filename]
<br>
309 Loading configuration [filename]. Ex.
"i:
8lconfig.html
" to reload config.html.
</p>
312 <p>i:
92[http request headers separated by ';']:[url]
<br>
313 The
"Host
" Header (fake header, different from the standard) must be the first header.
<br>
314 Ex. i:
92Host;
209.216.230.240:https://news.ycombinator.com
<br>
315 use
"i:
0mi:
92Host;
209.216.230.240::https://news.ycombinator.com
" to visit the site with specified IP address.
</p>
318 <p>i:b1[internal urls or javascript separated by
"%
0A
"]
<br>
319 Bundle of internal urls, if it is an
"i:
0" url, then it should have the following format:
<br>
320 [title]%
0A[msg]%
0A[optional callback url%
0A][i:
0url].
</p>
325 <p>Last Modified:
10 December
2024<br>
327 <pre>i:
56 urls support CTRL_A to CTRL-Z
331 <script id='jsgiscus'
332 src='https://giscus.app/client.js'
333 data-repo=
"torappinfo/uweb"
334 data-repo-id=
"MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
335 data-category=
"Announcements"
336 data-category-id=
"DIC_kwDOEgNLGc4CQjsh"
339 data-reactions-enabled=
"1"
340 data-emit-metadata=
"0"
341 data-input-position=
"top"
345 crossorigin=
"anonymous" async
>
348 <footer class=
"site-footer">
349 <div class=
"container">
350 © 2018-
2025 Richard H. Cao
353 <!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->