Skip to content

Instantly share code, notes, and snippets.

@davidmyersdev
Last active November 13, 2025 14:33
Show Gist options
  • Select an option

  • Save davidmyersdev/64c5bcf99566cc78b45c63e2604d5c56 to your computer and use it in GitHub Desktop.

Select an option

Save davidmyersdev/64c5bcf99566cc78b45c63e2604d5c56 to your computer and use it in GitHub Desktop.

Revisions

  1. davidmyersdev revised this gist Oct 31, 2025. 2 changed files with 33 additions and 5 deletions.
    33 changes: 33 additions & 0 deletions README.md
    Original 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,{});})();
    ```
    5 changes: 0 additions & 5 deletions devtools.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +0,0 @@
    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, {})
  2. davidmyersdev created this gist Oct 31, 2025.
    5 changes: 5 additions & 0 deletions devtools.js
    Original 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, {})