index.html 14 KB

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