add browser infos in html dataset
This commit is contained in:
parent
1ed7aa9c5b
commit
83f6a93d28
3 changed files with 19 additions and 3 deletions
7
package-lock.json
generated
7
package-lock.json
generated
|
|
@ -11,6 +11,7 @@
|
||||||
"@vue-pdf-viewer/viewer": "^1.4.3",
|
"@vue-pdf-viewer/viewer": "^1.4.3",
|
||||||
"@vue/compiler-sfc": "^3.5.6",
|
"@vue/compiler-sfc": "^3.5.6",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
"detect-browser": "^5.3.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"primevue": "^4.0.6",
|
"primevue": "^4.0.6",
|
||||||
|
|
@ -1074,6 +1075,12 @@
|
||||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",
|
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"node_modules/detect-browser": {
|
||||||
|
"version": "5.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/detect-browser/-/detect-browser-5.3.0.tgz",
|
||||||
|
"integrity": "sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/detect-libc": {
|
"node_modules/detect-libc": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
"@vue-pdf-viewer/viewer": "^1.4.3",
|
"@vue-pdf-viewer/viewer": "^1.4.3",
|
||||||
"@vue/compiler-sfc": "^3.5.6",
|
"@vue/compiler-sfc": "^3.5.6",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
"detect-browser": "^5.3.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"primevue": "^4.0.6",
|
"primevue": "^4.0.6",
|
||||||
|
|
|
||||||
14
src/App.vue
14
src/App.vue
|
|
@ -7,9 +7,17 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from 'pinia';
|
||||||
import Menu from "./components/Menu.vue";
|
import Menu from './components/Menu.vue';
|
||||||
import { usePageStore } from "./stores/page";
|
import { usePageStore } from './stores/page';
|
||||||
|
import { detect } from 'detect-browser';
|
||||||
|
|
||||||
|
const browser = detect();
|
||||||
|
|
||||||
|
if (browser) {
|
||||||
|
document.querySelector(
|
||||||
|
'html'
|
||||||
|
).dataset.browser = `${browser.name} ${browser.version} ${browser.os}`;
|
||||||
|
}
|
||||||
const { page } = storeToRefs(usePageStore());
|
const { page } = storeToRefs(usePageStore());
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue