Added options page
This commit is contained in:
parent
48b28fb665
commit
03c2ed4961
3 changed files with 33 additions and 11 deletions
|
|
@ -18,5 +18,9 @@
|
||||||
"48": "icon_48.png",
|
"48": "icon_48.png",
|
||||||
"128": "icon_128.png"
|
"128": "icon_128.png"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"options_ui": {
|
||||||
|
"page": "options.html",
|
||||||
|
"open_in_tab": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
15
public/options.html
Normal file
15
public/options.html
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- <div class="checkBoxWrap">
|
||||||
|
<input type="checkbox" id="clickOnly" name="clickOnly"/>
|
||||||
|
<label for="clickOnly">Run browser popup only when icon is clicked</label>
|
||||||
|
</div>
|
||||||
|
<div class="optionText">Github: <a target="_blank" href="https://github.com/z0ccc/Reddit-Wherever">https://github.com/z0ccc/Reddit-Wherever</a></div> -->
|
||||||
|
<div id="options"></div>
|
||||||
|
</body>
|
||||||
|
<script src="options.js"></script>
|
||||||
|
</html>
|
||||||
|
|
@ -13,6 +13,17 @@ const sortArr = (arr) => {
|
||||||
return list;
|
return list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const sortPlugins = (data) => {
|
||||||
|
const length = data.length;
|
||||||
|
|
||||||
|
let list = '';
|
||||||
|
for (let i = 0; i < length; i++) {
|
||||||
|
if (i !== 0) list += ', ';
|
||||||
|
list += data[i].name;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
};
|
||||||
|
|
||||||
const sendData = (data) => {
|
const sendData = (data) => {
|
||||||
fetch('http://localhost:8000/', {
|
fetch('http://localhost:8000/', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|
@ -24,16 +35,6 @@ const sendData = (data) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const TableWrap = () => {
|
const TableWrap = () => {
|
||||||
const uaResult = Bowser.parse(navigator.userAgent);
|
|
||||||
const date = new Date();
|
|
||||||
const pluginsLength = navigator.plugins.length;
|
|
||||||
|
|
||||||
let pluginList = '';
|
|
||||||
for (let i = 0; i < pluginsLength; i++) {
|
|
||||||
if (i !== 0) pluginList += ', ';
|
|
||||||
pluginList += navigator.plugins[i].name;
|
|
||||||
}
|
|
||||||
|
|
||||||
const [batLevel, setBatLevel] = useState('');
|
const [batLevel, setBatLevel] = useState('');
|
||||||
const [batStatus, setBatStatus] = useState('');
|
const [batStatus, setBatStatus] = useState('');
|
||||||
|
|
||||||
|
|
@ -49,6 +50,8 @@ const TableWrap = () => {
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const uaResult = Bowser.parse(navigator.userAgent);
|
||||||
|
const date = new Date();
|
||||||
const gl = document.createElement('canvas').getContext('webgl');
|
const gl = document.createElement('canvas').getContext('webgl');
|
||||||
const ext = gl.getExtension('WEBGL_debug_renderer_info');
|
const ext = gl.getExtension('WEBGL_debug_renderer_info');
|
||||||
|
|
||||||
|
|
@ -136,7 +139,7 @@ const TableWrap = () => {
|
||||||
{
|
{
|
||||||
key: 'plugins',
|
key: 'plugins',
|
||||||
title: 'Plugins',
|
title: 'Plugins',
|
||||||
value: pluginList || 'N/A',
|
value: sortPlugins(navigator.plugins) || 'N/A',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue