Enable Vue Dev Tools

Forces Vue Dev Tools to work in production builds on any page.

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name            Enable Vue Dev Tools
// @namespace       Enable Vue Dev Tools
// @match           *://*/*
// @grant           none
// @version         1.0
// @author          Alfredo3232
// @description     Forces Vue Dev Tools to work in production builds on any page.
// @license         GPL-3.0
// @homepageURL     https://github.com/Alfredo3232/webScripts
// @supportURL      https://github.com/Alfredo3232/webScripts/issues
// @compatible      firefox
// @compatible      librewolf
// ==/UserScript==

let activeVueTools = () => {
    // Find Vue 2
    let app = Array.from(document.querySelectorAll("*")).find((e) => e.__vue__).__vue__;

    if (app) {
        // Enable VueDevTools config
        const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
        devtools.enabled = true;

        // Enable VueDevTools
        let VueApp = Object.getPrototypeOf(app).constructor;

        while (VueApp.super) {
            VueApp = VueApp.super;
        }

        VueApp.config.devtools = true;

        // Restart Extension
        devtools.emit("init", VueApp);

        return;
    }

    // Find Vue 3
    if (app === undefined || app === null) {
        app = Array.from(document.querySelectorAll("*")).find((e) => e.__vue_app__).__vue_app__;

        if (app === undefined || app === null) return;
    }

    //  Initialize and enable VueDevTools config
    const version = app.version;
    const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
    devtools.enabled = true;

    // Restart Extension
    devtools.emit("app:init", app, version, {});

    return;
};

// Time out to prevent some pages from breaking
setTimeout(activeVueTools, 500);