-
Notifications
You must be signed in to change notification settings - Fork 254
/
index.js
36 lines (32 loc) · 876 Bytes
/
index.js
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
import React from 'react';
import ReactDOM from 'react-dom';
import Main from './Main';
const DEFAULT_SETTING = {
ajaxInterceptor_switchOn: false,
ajaxInterceptor_rules: [],
}
if (chrome.storage) {
chrome.storage.local.get(['ajaxInterceptor_switchOn', 'ajaxInterceptor_rules'], (result) => {
// if (result.ajaxInterceptor_switchOn) {
// this.set('ajaxInterceptor_switchOn', result.ajaxInterceptor_switchOn, false);
// }
// if (result.ajaxInterceptor_rules) {
// this.set('ajaxInterceptor_rules', result.ajaxInterceptor_rules, false);
// }
window.setting = {
...DEFAULT_SETTING,
...result,
};
ReactDOM.render(
<Main />,
document.getElementById('main')
);
});
} else {
window.setting = DEFAULT_SETTING;
// 测试环境
ReactDOM.render(
<Main />,
document.getElementById('main')
);
}