@abcnews/dev-proxy 中文文档教程
Dev script proxy
提供使用具有在 localStorage
中定义的设置的不同脚本覆盖 news-projects
脚本的功能。
被覆盖的脚本需要导入和使用此库:
import { proxy } from '@abcnews/dev-proxy';
function init() {
// The code that kicks off your script goes here.
}
proxy('project-name').then(init);
要使覆盖生效,localStorage
需要包含一个条目,该条目的键 proxy_
包含 URL要覆盖的脚本。
Bookmarklet
您可以使用 这个小书签帮助设置配置。
Dev script proxy
Provides the capability to override an news-projects
script with a different script with settings defined in localStorage
.
The script being overridden needs to import and use this library:
import { proxy } from '@abcnews/dev-proxy';
function init() {
// The code that kicks off your script goes here.
}
proxy('project-name').then(init);
To put the override into effect localStorage
needs to contain an entry with key proxy_<project-name>
that contains the URL of the script to override with.
Bookmarklet
You can use this bookmarklet to help setup the config.