Last active
November 13, 2025 14:33
-
-
Save davidmyersdev/64c5bcf99566cc78b45c63e2604d5c56 to your computer and use it in GitHub Desktop.
Revisions
-
davidmyersdev revised this gist
Oct 31, 2025 . 2 changed files with 33 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ ## Manually To enable Vue DevTools in a production application that disables the DevTools integration, you can run the following code in your browser console. ```js window.__VUE_DEVTOOLS_GLOBAL_HOOK__.enabled = true // Gather all Vue apps on the page. const apps = Array.from(document.querySelectorAll('[data-v-app]'), (element) => { return element.__vue_app__ }) // Register each Vue app with the DevTools extension. for (const app of apps) { window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('app:init', app, app.version, {}) } ``` ## With a bookmarklet Alternatively, you can create a bookmarklet to make it even easier to force-enable Vue DevTools in any production application. Create a new bookmark in your browser of choice with the following properties. Name: ``` Enable Vue DevTools ``` URL: ```js javascript:(()=>{window.__VUE_DEVTOOLS_GLOBAL_HOOK__.enabled=!0;const apps=Array.from(document.querySelectorAll("[data-v-app]"),p=>p.__vue_app__);for(const app of apps)window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit("app:init",app,app.version,{});})(); ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +0,0 @@ -
davidmyersdev created this gist
Oct 31, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ const app = document.querySelector('[data-v-app]').__vue_app__ const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__ devtools.enabled = true devtools.emit('app:init', app, app.version, {})