-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
52 lines (50 loc) · 1.47 KB
/
background.js
File metadata and controls
52 lines (50 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// @ts-nocheck
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
"use strict";
chrome.runtime.onInstalled.addListener(function () {
chrome.storage.sync.set({
"showdoc.ylzpay.com": {
selector: "table",
label: "说明",
prop: "参数名"
},
"192.168.11.242:4999": {
selector: "table",
label: "说明",
prop: "参数名"
},
"yapi.ylzpay.com": {
selector: ".ant-table",
label: "备注",
prop: "参数名称"
},
"element.eleme.cn": {
selector: "table",
label: '说明',
prop: '参数',
}
});
chrome.declarativeContent.onPageChanged.removeRules(undefined, function () {
chrome.declarativeContent.onPageChanged.addRules([
{
conditions: [
new chrome.declarativeContent.PageStateMatcher({
pageUrl: { hostEquals: "showdoc.ylzpay.com" },
}),
new chrome.declarativeContent.PageStateMatcher({
pageUrl: { hostEquals: "192.168.11.242:4999" },
}),
new chrome.declarativeContent.PageStateMatcher({
pageUrl: { hostEquals: "yapi.ylzpay.com" },
}),
new chrome.declarativeContent.PageStateMatcher({
pageUrl: { hostEquals: "element.eleme.cn" },
}),
],
actions: [new chrome.declarativeContent.ShowPageAction()],
},
]);
});
});