'How to determine if vue.js is used in a site or web app?

Is there a command in console? Or a tell tale sign like ng directives used in angular for vue that let you know if it's used in a site or app?



Solution 1:[1]

The Vue dev tools uses three different approaches.

One of the approaches is this:

// Method 3: Scan all elements inside document
const all = document.querySelectorAll('*')
let el
for (let i = 0; i < all.length; i++) {
  if (all[i].__vue__) {
    el = all[i]
    break
  }
}
if (el) {
  let Vue = Object.getPrototypeOf(el.__vue__).constructor
  while (Vue.super) {
    Vue = Vue.super
  }
  win.postMessage({
    devtoolsEnabled: Vue.config.devtools,
    vueDetected: true,
  }, '*')
  return
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David Groomes