2020-05-09 16:42:57 +02:00
<!doctype html>
< html >
< head >
2020-04-29 10:37:43 +02:00
< meta charset = "utf-8" >
2020-05-09 16:42:57 +02:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
2023-12-11 08:23:07 +01:00
2024-04-01 15:51:55 +02:00
< link rel = "stylesheet" href = "../style.css#" type = "text/css" / >
2023-01-28 02:52:52 +01:00
< title > 特定网址脚本、样式、额外html及预处理< / title >
2022-06-30 05:43:09 +02:00
< script type = "text/javascript" >
2022-07-12 04:24:02 +02:00
function findLang(){
2022-06-30 05:43:09 +02:00
let href = location.href;
for(let i=href.length-1;i>0;i--){
if('/'==href.charAt(i) & & '/'==href.charAt(i-3))
2022-07-12 04:24:02 +02:00
return i;
2022-06-30 05:43:09 +02:00
}
2022-07-12 04:24:02 +02:00
return 0;
}
function nav2(page){
let i = findLang();
location.href = location.href.substring(0,i+1)+page;
}
function nav2Lang(lang){
let i = findLang();
let href = location.href;
location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
2022-06-30 05:43:09 +02:00
}
< / script >
2020-05-09 16:42:57 +02:00
< / head >
< body >
< header class = 'header' >
2024-04-02 07:42:43 +02:00
< 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 >
2022-07-12 04:24:02 +02:00
< a class = "logo" href = "javascript:void(0)" onclick = "return nav2Lang('en')" > English< / a >
2020-05-09 16:42:57 +02:00
< nav >
< / nav >
< / header >
2020-08-29 02:42:46 +02:00
< br / >
2020-04-29 10:37:43 +02:00
2020-05-09 16:42:57 +02:00
< div class = "container" >
2023-01-28 02:52:52 +01:00
< h1 class = "title" > 特定网址脚本、样式、额外html及预处理
2020-05-09 16:42:57 +02:00
< br >
< span class = "subtitle" > < / span >
< / h1 >
< ul class = "tags" >
2020-04-29 10:37:43 +02:00
2024-04-01 15:51:55 +02:00
< li > < a href = "../tags/javascript/index.html#" > javascript< / a > < / li >
2020-04-29 10:37:43 +02:00
2024-04-01 15:51:55 +02:00
< li > < a href = "../tags/css/index.html#" > css< / a > < / li >
2020-04-29 10:37:43 +02:00
2020-05-09 16:42:57 +02:00
< / ul >
< p > 技巧等级:中级< / p >
2023-01-27 02:57:17 +01:00
< h3 id = "脚本-第一时间装载js脚本见下面sitecss条目" > 脚本 (第一时间装载js脚本见下面sitecss条目)< / h3 >
2020-04-29 10:37:43 +02:00
< ul >
2020-05-09 16:42:57 +02:00
< li > 脚本需命名为 " [根域名].js" , 譬如baidu.com.js 或tieba.baidu.com.js 。此脚本将自动作用于所有相同根域名的网址上。如有多个脚本满足条件,以最长文件名为准。< / li >
2023-01-28 02:41:12 +01:00
< li > 这些脚本需放到/data/data/info.torapp.uweb/files/sitejs目录下, 数量没有限制, 上百万都不成问题。< / li >
2020-04-29 10:37:43 +02:00
< li > 长按窗口按钮,勾选“执行网址用户脚本”。< / li >
< li > 脚本执行对浏览器无性能影响,即使有百万脚本存在。< / li >
2022-03-19 09:53:04 +01:00
< li > 目前支持两段、三段及少数四段域名( 最后两段不超过6字如com.cn的域名可取四段) 。所以脚本请不要以很长的域名来命名。< / li >
2020-04-29 10:37:43 +02:00
< / ul >
2023-01-27 02:57:17 +01:00
< h3 id = "样式及第一时间装载js脚本" > 样式及第一时间装载js脚本< / h3 >
2020-04-29 10:37:43 +02:00
< ul >
2020-05-09 16:42:57 +02:00
< li > 与此类似,用户样式需命名为 " [根域名].css" , 譬如baidu.com.css 或tieba.baidu.com.css。< / li >
2022-07-09 02:45:17 +02:00
< li > 样式文件需放到sitecss目录下。< / li >
2022-01-18 04:52:13 +01:00
< li > sitecss目录下" [根域名].js" 文件会在第一时间装载。< / li >
2020-04-29 10:37:43 +02:00
< li > 长按窗口按钮,勾选“使用网址用户样式”。< / li >
2022-07-09 02:45:17 +02:00
< li > 如果文件“default.css”存在, 访问网址时如果没有与域名匹配的css文件, 则使用此默认样式文件。< / li >
2020-04-29 10:37:43 +02:00
< li > default.css可作为夜间模式来使用, 此时default.css为夜间模式css, 而黑色主题类网址对应的域名为空文件。此种设定情况下仅白色主题网页会使用夜间模式css。< / li >
< / ul >
2023-01-28 02:41:12 +01:00
< h3 id = "额外html及预处理" > 额外html及预处理< / h3 >
2023-01-27 02:57:17 +01:00
< ul >
< li > 需命名为 " [域名].html" , 譬如baidu.com.html。注意此处与sitejs, sitecss不同, 不再是" [根域名]" 。< / li >
< li > 文件需放到siteextra目录下。< / li >
2023-01-28 02:41:12 +01:00
< li > 长按窗口按钮,勾选“网址附加内容”。< / li >
2023-01-27 02:57:17 +01:00
< / ul >
2023-01-28 02:41:12 +01:00
< p > 额外html可以以" < textarea> " 或" < div> < textarea> " 等结尾, 此时超微算法自动判定用户欲对网址html源代码进行处理, 并将网址html源码附加在用户html后面, 从而成为textarea元素的内容, 供用户进行预处理。< / p >
2023-01-27 02:57:17 +01:00
< p > 文件" sitejs/.js" ," sitecss/.css" ," sitecss/.js" 和" siteextra/.html" 可作用于一切非http url( 本地文件, 浏览器界面等) 。< / p >
2020-04-29 10:37:43 +02:00
< / div >
2024-04-02 07:42:43 +02:00
< p > Last Modified: 2 April 2024< br >
2023-03-07 03:07:05 +01:00
minor changes for zh< br >
< pre > < / pre >
< / p >
2024-03-21 02:04:37 +01:00
2023-05-06 03:56:44 +02:00
< script id = 'jsgiscus'
src='https://giscus.app/client.js'
data-repo="torappinfo/uweb"
data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
data-category="Announcements"
data-category-id="DIC_kwDOEgNLGc4CQjsh"
2023-05-06 04:49:29 +02:00
data-mapping="title"
2023-05-06 03:56:44 +02:00
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="light"
data-lang="en"
data-loading="lazy"
2023-05-06 04:49:29 +02:00
crossorigin="anonymous" async>
2023-05-06 03:40:28 +02:00
< / script >
2020-04-29 10:37:43 +02:00
2024-04-03 03:47:35 +02:00
< footer class = "site-footer" >
< div class = "container" >
2024-04-04 15:28:55 +02:00
© 2018-2024 Richard H. Cao
2024-04-03 03:47:35 +02:00
< / div >
< / footer >
2024-04-04 15:28:55 +02:00
<!-- 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/>. -->
2020-05-09 16:42:57 +02:00
< / body >
2020-04-29 10:37:43 +02:00
< / html >