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