index.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <link rel="stylesheet" href="../style.css#" type="text/css" />
  7. <title>Links</title>
  8. <script>
  9. function findLang(){
  10. let href = location.href;
  11. for(let i=href.length-1;i>0;i--){
  12. if('/'==href.charAt(i) && '/'==href.charAt(i-3))
  13. return i;
  14. }
  15. return 0;
  16. }
  17. function nav2(page){
  18. let i = findLang();
  19. location.href = location.href.substring(0,i+1)+page;
  20. }
  21. function nav2Lang(lang){
  22. let i = findLang();
  23. let href = location.href;
  24. location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
  25. }
  26. </script>
  27. </head>
  28. <body>
  29. <header class='header'>
  30. <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>
  31. <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
  32. <nav>
  33. </nav>
  34. </header>
  35. <br />
  36. <div class="container">
  37. <h1 class="title">Links
  38. <br>
  39. <span class="subtitle"></span>
  40. </h1>
  41. <ul class="tags">
  42. </ul>
  43. <p>Click the following links to install menus popped by long pressing the bookmark button (with star as icon):<br>
  44. <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>
  45. <p><a href="i:0gdefault.link:../searchurl/txt/link.cfg">Select All:CTRL-A/undo:CTRL-Z/Redo:CTRL-Y</a><br>
  46. <a href="i:0gdefault.link::Extend cookies::0cc;Max-Age=315360000%0A">Extend site cookies to 10 years</a><br>
  47. <a href="i:0gdefault.link::Clear cookies::0cc;Max-Age=0%0A">Clear site cookies</a></p>
  48. <p><a href="i:0gdefault.link::vpn:i:1dandroid.net.vpn.SETTINGS:::%0A">VPN</a></p>
  49. <p><a href="i:0gdefault.link::profile_config::cprofile . files .conf%0A">Switch configuration</a></p>
  50. <p><a href="i:0gdefault.link::Wait msg:i:1w%0A">Wait for network msg</a></p>
  51. <p><a href="i:0gdefault.link::Certificate info:i:1c%0A">Certificate info</a></p>
  52. <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>
  53. <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>
  54. <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>
  55. <p><a href="../searchurl/webdav.html">More webdav link menu items</a></p>
  56. <p><a href="i:0gdefault.link::web fullscreen: location.href='i:5fsetTimeout(()=>document.documentElement.requestFullscreen(),50);';%0A">Web fullscreen</a></p>
  57. <p>Long pressing the bookmark button in <a href="../index.html#">uweb browser</a> will popup menus defined in file &quot;default.link&quot;. The file format is as follows:<br>
  58. [Menu name]:[one or more links delimited by &quot; \n &quot;]</p>
  59. <p>and each link has the following format:<br>
  60. [url][space][javascript code]</p>
  61. <p>in which space and later parts are optional. url and later parts support <a href="../cmd/index.html#">&quot;%u&quot;,&quot;%s&quot; etc.</a>. The javascript code will be executed after url is fully loaded.</p>
  62. <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>
  63. <p>uweb browser will handle local file urls (file:///) specially for some file types:</p>
  64. <ul>
  65. <li>.js file(same as <a href="../longclick/index.html#">long pressing hypertext to execute js file</a>): If the &quot;.js&quot; file begins with &quot;//&quot;, then uweb browser will load the site following &quot;//&quot; and execute the following js code.</li>
  66. </ul>
  67. <p>If the above mentioned [links] part is malformated, then it is auto detected as html or text.</p>
  68. <p><a href="../gesture/index.html#">default.gesture</a> and default.button have the exactly same file format. &quot;.gesture&quot; files define gestures while &quot;.button&quot; define bottom toolbar button pressing actions from the last button to the first.</p>
  69. <p>proxy config:<br>
  70. httpproxy::010[proxy host]:[port]:[username]:[password]<br>
  71. socks5::011[socks host]:[port]:[username]:[password]<br>
  72. noproxy::010:</p>
  73. <h3 id="special-links-beginning-with-">special links beginning with ':'</h3>
  74. <ul>
  75. <li>
  76. <p>:0003<br>
  77. Toggle fullscreen mode</p>
  78. </li>
  79. <li>
  80. <p>:0004<br>
  81. Rotate the screen</p>
  82. </li>
  83. <li>
  84. <p>:001[fileurl]<br>
  85. Scan the fileurl and add it to media storage</p>
  86. </li>
  87. <li>
  88. <p>:010[proxy host]:[port]:[username]:[password]<br>
  89. Config http proxy, &quot;:010:&quot; to disable any proxy.<br>
  90. &quot;:[username]:[password]&quot; is optional.</p>
  91. </li>
  92. <li>
  93. <p>:011[socks host]:[port]:[username]:[password]<br>
  94. Socks proxy, &quot;:[username]:[password]&quot; is optional.</p>
  95. </li>
  96. <li>
  97. <p>:0cc[url1]:[url2][:;[cookie attributes]]<br>
  98. cookie copy from url1 to url2, the last part &quot;[:;[cookie attributes]]&quot; is optionable.</p>
  99. </li>
  100. </ul>
  101. <h4 id="commands">commands</h4>
  102. <ul>
  103. <li>
  104. <p>:![command line]<br>
  105. The command line could be a &quot;.js&quot;, &quot;.sh&quot; or other executable with arguments. Ex. &quot;:!s g keyword&quot; could invoke &quot;s.js&quot; executable with the whole string as arguments (&quot;s.sh&quot; or &quot;s&quot; if file exists, here &quot;g&quot; as google search engine); &quot;:! g keyword&quot; would invoke the file &quot;.js&quot; or &quot;.sh&quot; as executable.</p>
  106. <p>For regular (non-js) executables, the standard output of the command line will be treated as lines of web urls.</p>
  107. <p><a href="i:0hs.sh:../searchurl/txt/web.sh">Click to install the example file &quot;s.sh&quot;</a><br>
  108. <a href="i:0h.js:../searchurl/txt/web.js">Click to install the example file &quot;.js&quot;</a></p>
  109. </li>
  110. <li>
  111. <p>:c[command]</p>
  112. <ul>
  113. <li>close<br>
  114. &quot;:cclose&quot; to close the current window/tab.</li>
  115. <li>profile [parent folder] [file/folder] [optional ID]<br>
  116. Ex. &quot;:cprofile . files&quot; to switch configurations</li>
  117. <li>set [key] [value]<br>
  118. [key] could be one of the followings:
  119. <ul>
  120. <li>redirecturl</li>
  121. </ul>
  122. </li>
  123. </ul>
  124. </li>
  125. <li>
  126. <p>:p [width in milliInch]x[height] [top margin]:[right margin]:[bottom margin]:[left margin]<br>
  127. Generate/Print PDF file in the &quot;/sdcard/Download&quot; folder, all units are milliinch.<br>
  128. Ex. &quot;:p x&quot; or &quot;:px&quot; for screen width and infinite height (as long vector screenshot).<br>
  129. &quot;:p x[height]&quot; or &quot;:px[height]&quot; for screen width.</p>
  130. </li>
  131. </ul>
  132. <h3 id="i-internal-links">&quot;i:&quot; internal links:</h3>
  133. <ul>
  134. <li>
  135. <p>i:0b[path]:[url]<br>
  136. Extract remote content (tar/tgz/zip) under the folder [path]. If [path] ends with &quot;/&quot;, then put unzipped file under the folder &quot;[path]/[file name stem]&quot; (for zipped files only, not for tar/tgz).</p>
  137. </li>
  138. <li>
  139. <p>i:0m[-|1-9][bookmarklet index|prefix|?postfix|/.../localfile|H[headers]|c[cssFlag]]:[url]<br>
  140. Visiting url and execute the uweb browser internal bookmarklet that keeps valid for all urls under the parent path of [url].</p>
  141. <ul>
  142. <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>
  143. <li>[bookmarklet index] must have two digits. They are used as index of bootmarklet. For example, &quot;00&quot; as the first local bookmarklet; &quot;01&quot; as the first remote script; then &quot;02&quot; as the second local bookmarklet, ...</li>
  144. <li>c[cssFlag]: For example, &quot;c12&quot; will apply the third and fourth global CSS (12=2^2+2^3).</li>
  145. <li>H[headers]: Ex. &quot;HX-Forwarded-For;8.8.8.8&quot; adds extra http request header &quot;X-Forwarded-For:8.8.8.8&quot;.</li>
  146. <li>[?postfix]: the real visited url is &quot;[url]+[?postfix]&quot;.</li>
  147. <li>[/.../localfile]: load the local html/js file that processes [url]. The first character of the local html file must be &quot;&lt;&quot;.</li>
  148. <li>All other cases will be treated as [prefix], the real visited url is &quot;[prefix]+[url]&quot;.</li>
  149. <li>Since <a href="../rjs/index.html#">activated scripts</a> use internal mechanism of &quot;i:0m&quot; urls, the script itself cannot have 'H', '?' as its very first character.</li>
  150. </ul>
  151. </li>
  152. <li>
  153. <p>i:15[string]<br>
  154. Set address bar text to be [string].</p>
  155. </li>
  156. <li>
  157. <p>i:16[mimetype]:[Action Name]:[App Name]:[Activity Name]<br>
  158. Use third party app as input</p>
  159. </li>
  160. <li>
  161. <p>i:18[extended mimetype]:[range]:[url]<br>
  162. Read partial data from url.<br>
  163. <range>: the format is same as related http header, such as &quot;500-1000,-300&quot;.<br>
  164. <extended mimetype>: standard mimetype or mimetype followed by &quot;.<filename>&quot;. In the later case, the file in uweb configuration folder will be appended to the fetched data.</p>
  165. </li>
  166. <li>
  167. <p>i:19[string]<br>
  168. Append [string] to the address bar text.</p>
  169. </li>
  170. <li>
  171. <p>i:1c<br>
  172. Show web certificate.</p>
  173. </li>
  174. <li>
  175. <p>i:1d<action>:<type>:<Category>:<data><br>
  176. Launch app for specific <action>.</p>
  177. </li>
  178. <li>
  179. <p>i:1w<br>
  180. Wait to receive url from the network and open the url.</p>
  181. </li>
  182. <li>
  183. <p>i:1w1<br>
  184. Wait to receive url from the network and open the url (not showing ip)</p>
  185. </li>
  186. <li>
  187. <p>i:1e<br>
  188. Open file manager for removable SDCARD download folder</p>
  189. </li>
  190. <li>
  191. <p>i:50[path]:[string]<br>
  192. Save [string] as file</p>
  193. </li>
  194. <li>
  195. <p>i:51[path]:[url]<br>
  196. Save [url] to &quot;.autoc&quot; file.</p>
  197. </li>
  198. <li>
  199. <p>i:52[path]:[url]<br>
  200. Save bookmark.</p>
  201. </li>
  202. <li>
  203. <p>i:53[path]:[string]<br>
  204. Save notes.</p>
  205. </li>
  206. <li>
  207. <p>i:54[path]:[url]<br>
  208. Save as search engine.</p>
  209. </li>
  210. <li>
  211. <p>i:55[path]:[url]<br>
  212. Save as link.</p>
  213. </li>
  214. <li>
  215. <p>i:56[string]<br>
  216. Use [string] as user input on web page.<br>
  217. 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 &quot;Ctrl-A&quot; into a text file, use &quot;Ctrl-Q Ctrl-A&quot; with emacs or &quot;Ctrl-V Ctrl-A&quot; with vim)</p>
  218. </li>
  219. <li>
  220. <p>i:57[jscode]<br>
  221. execute [jscode], even when js is disabled for the web page.</p>
  222. </li>
  223. <li>
  224. <p>i:58[url]<br>
  225. Save to the desktop.</p>
  226. </li>
  227. <li>
  228. <p>i:5a[filename]<br>
  229. Receive content from network to the file.</p>
  230. </li>
  231. <li>
  232. <p>i:5b[string]<br>
  233. Copy [string] to the clipboard.</p>
  234. </li>
  235. <li>
  236. <p>i:5c[url]<br>
  237. Change auto page turning internal url to be [url].</p>
  238. </li>
  239. <li>
  240. <p>i:5d[file url]<br>
  241. Open the file url compatible to other browsers.</p>
  242. </li>
  243. <li>
  244. <p>i:5e[string]<br>
  245. TTS</p>
  246. </li>
  247. <li>
  248. <p>i:5f[videourl]<br>
  249. play video fullscreen. if videourl is empty, then make following requestFullscreen() work.</p>
  250. </li>
  251. <li>
  252. <p>i:5h[?postfix:|/regex/replacement:|encoding:][url]<br>
  253. force html for [url] visiting</p>
  254. <ul>
  255. <li>[?postfix:] : the real url visited is &quot;[url]+[?postfix]&quot;</li>
  256. <li>[/regex/replacement:]: execute regular expression replacement for the &quot;[url]&quot;, then visit the resulting url.</li>
  257. <li>[encoding:]: force web page encoding.</li>
  258. </ul>
  259. </li>
  260. <li>
  261. <p>i:5i[url]<br>
  262. Use the existing tab for the url with possible different url hash part.</p>
  263. </li>
  264. <li>
  265. <p>i:5j[string]<br>
  266. if [string] is file url, then send the file/folder to network, otherwise send [string] to network.</p>
  267. </li>
  268. <li>
  269. <p>i:5p[videourl]<br>
  270. play video in external player</p>
  271. </li>
  272. <li>
  273. <p>i:60[path]:[url]<br>
  274. If existing local file, then open it or visit the [url].</p>
  275. </li>
  276. <li>
  277. <p>i:62[path]:[js code]<br>
  278. Evaluate the [js code] and save the returned string to file.</p>
  279. </li>
  280. <li>
  281. <p>i:63[bookmarklet index]:[url]<br>
  282. Visiting url and execute the bookmarklet. Only uweb predefined local bookmarlets are allowed.</p>
  283. </li>
  284. <li>
  285. <p>i:6i[js file path relative to configuration folder]:[url]<br>
  286. Similar to i:5i, except executing the js file after possible url hash change.</p>
  287. </li>
  288. <li>
  289. <p>i:70[url]:[auto page turning url]<br>
  290. Visiting [url], but use the second url as auto paging url.</p>
  291. </li>
  292. <li>
  293. <p>i:8d[url]<br>
  294. Force downloading [url]</p>
  295. </li>
  296. <li>
  297. <p>i:8l[filename]<br>
  298. Loading configuration [filename]. Ex. &quot;i:8lconfig.html&quot; to reload config.html.</p>
  299. </li>
  300. <li>
  301. <p>i:92[http request headers separated by ';']:[url]<br>
  302. The &quot;Host&quot; Header (fake header, different from the standard) must be the first header.<br>
  303. Ex. i:92Host;209.216.230.240:https://news.ycombinator.com<br>
  304. use &quot;i:0mi:92Host;209.216.230.240::https://news.ycombinator.com&quot; to visit the site with specified IP address.</p>
  305. </li>
  306. <li>
  307. <p>i:b1[internal urls or javascript separated by &quot;%0A&quot;]<br>
  308. Bundle of internal urls, if it is an &quot;i:0&quot; url, then it should have the following format:<br>
  309. [title]%0A[msg]%0A[optional callback url%0A][i:0url].</p>
  310. </li>
  311. </ul>
  312. </div>
  313. <p>Last Modified: 11 November 2024<br>
  314. support proxies with username and password<br>
  315. <pre>i:56 urls support CTRL_A to CTRL-Z
  316. </pre>
  317. </p>
  318. <script id='jsgiscus'
  319. src='https://giscus.app/client.js'
  320. data-repo="torappinfo/uweb"
  321. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  322. data-category="Announcements"
  323. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  324. data-mapping="title"
  325. data-strict="0"
  326. data-reactions-enabled="1"
  327. data-emit-metadata="0"
  328. data-input-position="top"
  329. data-theme="light"
  330. data-lang="en"
  331. data-loading="lazy"
  332. crossorigin="anonymous" async>
  333. </script>
  334. <footer class="site-footer">
  335. <div class="container">
  336. &copy; 2018-2024 Richard H. Cao
  337. </div>
  338. </footer>
  339. <!-- 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/>. -->
  340. </body>
  341. </html>