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