您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This userscript provides an API to modify the viewing experience of Inoreader
This userscript provides an API for other userscripts to modify the viewing experience of Inoreader.
Based on Kenya-West/userscript-typescript-template-kw.
Just write your styles in src/assets/styles/styles.scss
and they will append in web page's <head></head>
!
You can also add your own files with .css
or .scss
extension in StylesInjecter
class.
The repository generates two different assets (files):
index.user.js
);index.hot-reload.user.js
) has userscript's meta info and reference to the first asset so you can copy and paste its entire code to Tampermonkey once.This allows you faster updating scripts by automatically picking up recent changes.
The project has different classes to:
This scripts produces list of events, prefixed with tm_inoreader-viewing-api-for-userscripts_
:
Event Name | Description |
---|---|
articleAdded |
Triggered when a article is added. It appies both for new and read articles. |
articleNewAdded |
Triggered when a new article is added. |
articleReadAdded |
Triggered when an already read read article is added. |
articleMediaLoadCompleted |
Triggered when the media associated with an article has finished loading. It appies both for new and read articles. |
articleMediaLoadFailed |
Triggered when the media associated with an article has failed to load. It appies both for new and read articles. |
articleMediaLoadSuccess |
Triggered when the media associated with an article has successfully loaded. It appies both for new and read articles. |
articleNewMediaLoadCompleted |
Triggered when the media associated with a new article has finished loading. |
articleNewMediaLoadFailed |
Triggered when the media associated with a new article has failed to load. |
articleNewMediaLoadSuccess |
Triggered when the media associated with a new article has successfully loaded. |
articleReadMediaLoadCompleted |
Triggered when the media associated with a read article has finished loading. |
articleReadMediaLoadFailed |
Triggered when the media associated with a read article has failed to load. |
articleReadMediaLoadSuccess |
Triggered when the media associated with a read article has successfully loaded. |
articleModified |
Triggered when an article is modified. |
In your userscript, you can subscribe to events like this:
document.addEventListener('tm_inoreader-viewing-api-for-userscripts_articleAdded', (e) => {
// your code
// All data is in `e.detail?.details`
});
All data is accessed through e.detail?.details
object. It contains element
(HTMLElement
) of article and various flags and text data of the article. Look into element.model.ts file to see which fields are available to read.
# Use Github CLI
$ gh repo clone kenya-west/inoreader-viewing-api-for-userscripts
# Or use 'git clone' command directly
$ git clone https://github.com/Kenya-West/inoreader-viewing-api-for-userscripts.git
npm ci
.userscript
object in package.json
, you can refer to the comments in plugins/userscript.plugin.ts
.src
directory (like src/index.ts
).npm run build
or npm run build:watch
to auto-update resulting bundle on changes.index.hot-reload.user.ts
to Tampermonkey -> Add new script.You need install other loader plugins to support other file types.
Allow Tampermonkey's access to local file URIs (Tampermonkey FAQs) and import built userscript's file URL.
You can publish your userscript to Greasy Fork or other websites.
You can push your userscript to Github and import it to Greasy Fork.