aa
Some checks failed
test / Run tests (push) Failing after 14s
build / Build (push) Failing after 19s
Some checks failed
test / Run tests (push) Failing after 14s
build / Build (push) Failing after 19s
This commit is contained in:
@ -63,7 +63,7 @@ export default class GMApi {
|
||||
// 单次回调使用
|
||||
public sendMessage(api: string, params: any[]) {
|
||||
return this.message.sendMessage({
|
||||
action: "serviceWorker/runtime/gmApi",
|
||||
action: "runtime/gmApi",
|
||||
data: {
|
||||
uuid: this.scriptRes.uuid,
|
||||
api,
|
||||
@ -75,7 +75,7 @@ export default class GMApi {
|
||||
// 长连接使用,connect只用于接受消息,不发送消息
|
||||
public connect(api: string, params: any[]) {
|
||||
return this.message.connect({
|
||||
action: "serviceWorker/runtime/gmApi",
|
||||
action: "runtime/gmApi",
|
||||
data: {
|
||||
uuid: this.scriptRes.uuid,
|
||||
api,
|
||||
|
@ -1,5 +1,34 @@
|
||||
import { Script } from "@App/app/repo/scripts";
|
||||
|
||||
export const unsafeHeaders: { [key: string]: boolean } = {
|
||||
// 部分浏览器中并未允许
|
||||
"user-agent": true,
|
||||
// 这两个是前缀
|
||||
"proxy-": true,
|
||||
"sec-": true,
|
||||
// cookie已经特殊处理
|
||||
cookie: true,
|
||||
"accept-charset": true,
|
||||
"accept-encoding": true,
|
||||
"access-control-request-headers": true,
|
||||
"access-control-request-method": true,
|
||||
connection: true,
|
||||
"content-length": true,
|
||||
date: true,
|
||||
dnt: true,
|
||||
expect: true,
|
||||
"feature-policy": true,
|
||||
host: true,
|
||||
"keep-alive": true,
|
||||
origin: true,
|
||||
referer: true,
|
||||
te: true,
|
||||
trailer: true,
|
||||
"transfer-encoding": true,
|
||||
upgrade: true,
|
||||
via: true,
|
||||
};
|
||||
|
||||
export function storageKey(script: Script): string {
|
||||
if (script.metadata && script.metadata.storagename) {
|
||||
return script.metadata.storagename[0];
|
||||
|
Reference in New Issue
Block a user