uweb/zh/sitejs/index.html

114 lines
4.9 KiB
HTML
Raw Permalink Normal View History

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