Coder Social home page Coder Social logo

Comments (1)

XIU2 avatar XIU2 commented on June 10, 2024

这个脚本如名字所说,主要是负责加速下载的单一功能脚本,并不考虑将其功能扩充。
因此也不会添加和 加速下载 无关的功能。


但对于你这个需求我也可以提供一些帮助。

需求一:

如果你安装了 Stylus 扩展(用于向各个网站插入自定义的 CSS 样式,可以算是 CSS 版的油猴脚本[油猴脚本是向网站插入执行自定义的 JS 脚本]),那么可以添加一个样式规则,CSS 样式内容如下:

/* 搜索栏浮动固定在网页顶部 */
header.AppHeader {
    position: fixed !important;
    width: 100% !important;
    top: 0px !important;
    z-index: 100 !important;
}
/* 网页向下移动一些距离,避免网页顶部内容被搜索栏遮挡 */
.application-main {
    margin-top: 64px !important;
}

样式规则匹配页面选择 前缀,然后写入下面这个即可。

https://github.com/search

当然,你可以选择新建一个油猴脚本,然后匹配这个 URL 前缀,并手动向网页中插入上述 CSS 样式。


需求二:

可以安装我的另一个 [自动无缝翻页] 油猴脚本,其支持 Github 搜索页(及其他页面)自动翻页,同时还附带了一个左下角的页码按钮,鼠标右键这个按钮就能回到网页顶部。


需求一 + 需求二:

我的 [自动无缝翻页] 油猴脚本支持自定义规则,包括自定义/补充内置规则,而规则中也支持给网页插入样式,因此只需要天玑一个自定义翻页规则,来给脚本内置的 Github - Search 规则添加一个 style 规则即可,这样脚本会自动在搜索页插入自定义的 CSS 样式来让搜索栏浮动固定在网页顶部,同时也可以使用脚本左下角的页码按钮来快速回到顶部。

复制粘贴到脚本 自定义翻页规则 默认的 { } 中间保存(浏览器右上角 Tampermonkey 扩展图标内的脚本菜单)

	"Github - Search": {
		"style": "header.AppHeader {position: fixed !important;width: 100% !important;top: 0px !important;z-index: 100 !important;} .application-main {margin-top: 64px !important;}",
		"inherits": true
	}

from userscript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.