index.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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 type="text/javascript">
  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]<br>
  71. socks5::011[socks host]:[port]<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]<br>
  89. Config http proxy, &quot;:010:&quot; to disable any proxy.</p>
  90. </li>
  91. <li>
  92. <p>:011[socks host]:[port]<br>
  93. Socks proxy</p>
  94. </li>
  95. <li>
  96. <p>:0cc[url1]:[url2][:;[cookie attributes]]<br>
  97. cookie copy from url1 to url2, the last part &quot;[:;[cookie attributes]]&quot; is optionable.</p>
  98. </li>
  99. </ul>
  100. <h4 id="commands">commands</h4>
  101. <ul>
  102. <li>
  103. <p>:![command line]<br>
  104. 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>
  105. <p>For regular (non-js) executables, the standard output of the command line will be treated as lines of web urls.</p>
  106. <p><a href="i:0hs.sh:../searchurl/txt/web.sh">Click to install the example file &quot;s.sh&quot;</a><br>
  107. <a href="i:0h.js:../searchurl/txt/web.js">Click to install the example file &quot;.js&quot;</a></p>
  108. </li>
  109. <li>
  110. <p>:c[command]</p>
  111. <ul>
  112. <li>close<br>
  113. &quot;:cclose&quot; to close the current window/tab.</li>
  114. <li>profile [parent folder] [file/folder] [optional ID]<br>
  115. Ex. &quot;:cprofile . files&quot; to switch configurations</li>
  116. </ul>
  117. </li>
  118. <li>
  119. <p>:p [width in milliInch]x[height] [top margin]:[right margin]:[bottom margin]:[left margin]<br>
  120. Generate/Print PDF file in the &quot;/sdcard/Download&quot; folder, all units are milliinch.<br>
  121. Ex. &quot;:p x&quot; or &quot;:px&quot; for screen width and infinite height (as long vector screenshot).<br>
  122. &quot;:p x[height]&quot; or &quot;:px[height]&quot; for screen width.</p>
  123. </li>
  124. </ul>
  125. <h3 id="i-internal-links">&quot;i:&quot; internal links:</h3>
  126. <ul>
  127. <li>
  128. <p>i:0b[path]:[url]<br>
  129. 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>
  130. </li>
  131. <li>
  132. <p>i:0m[-|1-9][bookmarklet index|prefix|?postfix|/.../localfile|H[headers]|c[cssFlag]]:[url]<br>
  133. Visiting url and execute the uweb browser internal bookmarklet that keeps valid for all urls under the parent path of [url].</p>
  134. <ul>
  135. <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>
  136. <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>
  137. <li>c[cssFlag]: For example, &quot;c12&quot; will apply the third and fourth global CSS (12=2^2+2^3).</li>
  138. <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>
  139. <li>[?postfix]: the real visited url is &quot;[url]+[?postfix]&quot;.</li>
  140. <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>
  141. <li>All other cases will be treated as [prefix], the real visited url is &quot;[prefix]+[url]&quot;.</li>
  142. <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>
  143. </ul>
  144. </li>
  145. <li>
  146. <p>i:15[string]<br>
  147. Set address bar text to be [string].</p>
  148. </li>
  149. <li>
  150. <p>i:16[mimetype]:[Action Name]:[App Name]:[Activity Name]<br>
  151. Use third party app as input</p>
  152. </li>
  153. <li>
  154. <p>i:18[extended mimetype]:[range]:[url]<br>
  155. Read partial data from url.<br>
  156. <range>: the format is same as related http header, such as &quot;500-1000,-300&quot;.<br>
  157. <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>
  158. </li>
  159. <li>
  160. <p>i:19[string]<br>
  161. Append [string] to the address bar text.</p>
  162. </li>
  163. <li>
  164. <p>i:1c<br>
  165. Show web certificate.</p>
  166. </li>
  167. <li>
  168. <p>i:1d<action>:<type>:<Category>:<data><br>
  169. Launch app for specific <action>.</p>
  170. </li>
  171. <li>
  172. <p>i:1w<br>
  173. Wait to receive url from the network and open the url.</p>
  174. </li>
  175. <li>
  176. <p>i:1w1<br>
  177. Wait to receive url from the network and open the url (not showing ip)</p>
  178. </li>
  179. <li>
  180. <p>i:1e<br>
  181. Open file manager for removable SDCARD download folder</p>
  182. </li>
  183. <li>
  184. <p>i:50[path]:[string]<br>
  185. Save [string] as file</p>
  186. </li>
  187. <li>
  188. <p>i:51[path]:[url]<br>
  189. Save [url] to &quot;.autoc&quot; file.</p>
  190. </li>
  191. <li>
  192. <p>i:52[path]:[url]<br>
  193. Save bookmark.</p>
  194. </li>
  195. <li>
  196. <p>i:53[path]:[string]<br>
  197. Save notes.</p>
  198. </li>
  199. <li>
  200. <p>i:54[path]:[url]<br>
  201. Save as search engine.</p>
  202. </li>
  203. <li>
  204. <p>i:55[path]:[url]<br>
  205. Save as link.</p>
  206. </li>
  207. <li>
  208. <p>i:56[string]<br>
  209. Use [string] as user input on web page.<br>
  210. 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>
  211. </li>
  212. <li>
  213. <p>i:57[jscode]<br>
  214. execute [jscode], even when js is disabled for the web page.</p>
  215. </li>
  216. <li>
  217. <p>i:58[url]<br>
  218. Save to the desktop.</p>
  219. </li>
  220. <li>
  221. <p>i:5a[filename]<br>
  222. Receive content from network to the file.</p>
  223. </li>
  224. <li>
  225. <p>i:5b[string]<br>
  226. Copy [string] to the clipboard.</p>
  227. </li>
  228. <li>
  229. <p>i:5c[url]<br>
  230. Change auto page turning internal url to be [url].</p>
  231. </li>
  232. <li>
  233. <p>i:5d[file url]<br>
  234. Open the file url compatible to other browsers.</p>
  235. </li>
  236. <li>
  237. <p>i:5e[string]<br>
  238. TTS</p>
  239. </li>
  240. <li>
  241. <p>i:5f[videourl]<br>
  242. play video fullscreen. if videourl is empty, then make following requestFullscreen() work.</p>
  243. </li>
  244. <li>
  245. <p>i:5h[?postfix:|/regex/replacement:|encoding:][url]<br>
  246. force html for [url] visiting</p>
  247. <ul>
  248. <li>[?postfix:] : the real url visited is &quot;[url]+[?postfix]&quot;</li>
  249. <li>[/regex/replacement:]: execute regular expression replacement for the &quot;[url]&quot;, then visit the resulting url.</li>
  250. <li>[encoding:]: force web page encoding.</li>
  251. </ul>
  252. </li>
  253. <li>
  254. <p>i:5i[url]<br>
  255. Use the existing tab for the url with possible different url hash part.</p>
  256. </li>
  257. <li>
  258. <p>i:5j[string]<br>
  259. if [string] is file url, then send the file/folder to network, otherwise send [string] to network.</p>
  260. </li>
  261. <li>
  262. <p>i:5p[videourl]<br>
  263. play video in external player</p>
  264. </li>
  265. <li>
  266. <p>i:60[path]:[url]<br>
  267. If existing local file, then open it or visit the [url].</p>
  268. </li>
  269. <li>
  270. <p>i:62[path]:[js code]<br>
  271. Evaluate the [js code] and save the returned string to file.</p>
  272. </li>
  273. <li>
  274. <p>i:63[bookmarklet index]:[url]<br>
  275. Visiting url and execute the bookmarklet. Only uweb predefined local bookmarlets are allowed.</p>
  276. </li>
  277. <li>
  278. <p>i:6i[js file path relative to configuration folder]:[url]<br>
  279. Similar to i:5i, except executing the js file after possible url hash change.</p>
  280. </li>
  281. <li>
  282. <p>i:70[url]:[auto page turning url]<br>
  283. Visiting [url], but use the second url as auto paging url.</p>
  284. </li>
  285. <li>
  286. <p>i:8d[url]<br>
  287. Force downloading [url]</p>
  288. </li>
  289. <li>
  290. <p>i:8l[filename]<br>
  291. Loading configuration [filename]. Ex. &quot;i:8lconfig.html&quot; to reload config.html.</p>
  292. </li>
  293. <li>
  294. <p>i:92[http request headers separated by ';']:[url]<br>
  295. The &quot;Host&quot; Header (fake header, different from the standard) must be the first header.<br>
  296. Ex. i:92Host;209.216.230.240:https://news.ycombinator.com<br>
  297. use &quot;i:0mi:92Host;209.216.230.240::https://news.ycombinator.com&quot; to visit the site with specified IP address.</p>
  298. </li>
  299. <li>
  300. <p>i:b1[internal urls or javascript separated by &quot;%0A&quot;]<br>
  301. Bundle of internal urls, if it is an &quot;i:0&quot; url, then it should have the following format:<br>
  302. [title]%0A[msg]%0A[optional callback url%0A][i:0url].</p>
  303. </li>
  304. </ul>
  305. </div>
  306. <p>Last Modified: 29 April 2024<br>
  307. update i:0m syntax<br>
  308. <pre>i:56 urls support CTRL_A to CTRL-Z
  309. </pre>
  310. </p>
  311. <script id='jsgiscus'
  312. src='https://giscus.app/client.js'
  313. data-repo="torappinfo/uweb"
  314. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  315. data-category="Announcements"
  316. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  317. data-mapping="title"
  318. data-strict="0"
  319. data-reactions-enabled="1"
  320. data-emit-metadata="0"
  321. data-input-position="top"
  322. data-theme="light"
  323. data-lang="en"
  324. data-loading="lazy"
  325. crossorigin="anonymous" async>
  326. </script>
  327. <footer class="site-footer">
  328. <div class="container">
  329. &copy; 2018-2024 Richard H. Cao
  330. </div>
  331. </footer>
  332. <!-- 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/>. -->
  333. </body>
  334. </html>