diff --git a/public/manifest.json b/public/manifest.json index f31190c..d521e97 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -18,5 +18,9 @@ "48": "icon_48.png", "128": "icon_128.png" } + }, + "options_ui": { + "page": "options.html", + "open_in_tab": false } } diff --git a/public/options.html b/public/options.html new file mode 100644 index 0000000..50eb5f9 --- /dev/null +++ b/public/options.html @@ -0,0 +1,15 @@ + + + + + + + +
+ + + \ No newline at end of file diff --git a/src/components/TableWrap.js b/src/components/TableWrap.js index 1b5cd35..ce1476b 100644 --- a/src/components/TableWrap.js +++ b/src/components/TableWrap.js @@ -13,6 +13,17 @@ const sortArr = (arr) => { 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) => { fetch('http://localhost:8000/', { method: 'POST', @@ -24,16 +35,6 @@ const sendData = (data) => { }; 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 [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 ext = gl.getExtension('WEBGL_debug_renderer_info'); @@ -136,7 +139,7 @@ const TableWrap = () => { { key: 'plugins', title: 'Plugins', - value: pluginList || 'N/A', + value: sortPlugins(navigator.plugins) || 'N/A', }, ];