Nuxt.js: Ability to remove $nuxt helper from window

Created on 29 Aug 2020  路  9Comments  路  Source: nuxt/nuxt.js

I know this discussed before,

Check this website ozon.ru, it using Nuxt.js but doesn't have $nuxt inside window, how?

feature-request

All 9 comments

e.g. by using delete window.$nuxt. But be aware that:

  1. This will likely have side effects and things can break
  2. This won't stop users from having access to vue instances.

Related: https://github.com/nuxt/nuxt.js/issues/4720

e.g. by using delete window.$nuxt. But be aware that:

  1. This will likely have side effects and things can break
  2. This won't stop users from having access to vue instances.

Related: #4720

I know about side effects with transitions and nextTick method

can you please show how to access to vue instances on ozon.ru ?
I can't find anything inside window, the only thing i found is onAppReady and on AppReadyCbs, meaning they set globalName: 'app'

@pi0 can you answer this

the guy above got 2k for docs, can't even answer

https://i.imgur.com/PyWieji.png

Dear @saint777, Your actions are totally against community guidelines and out of respect. Nuxt.js is an opensource project maintained and supported by people that use their free time and passion of contributing. No one is obligated to immediately answer to your questions or do support while you do not even respect issue template! And of course no one forced you to use a product that don't like for any reason.

I shouldn't have answered this issue but as respect and for your curiosity, yes! it is possible to access vue instance in your website. As you may already find my answer in #4720, even by using a globalName, i'm able to access your $api service using document.querySelector('#__ozon').__vue__.$api and also vuex! (mutation is possible of course)

image

This is not nuxt specific or because global $nuxt. Same is possible for any frontend framework including react and vue if you have proper knowledge. With react devtools you can see structure of almost any react website: (this is twitter.com)

image

Same is possible for any vue app via vue-devtools but it is intentionally disabled in published version.

Dear @saint777, Your actions are totally against community guidelines and out of respect. Nuxt.js is an opensource project maintained and supported by people that use their free time and passion of contributing. No one is obligated to immediately answer to your questions or do support while you do not even respect issue template! And of course no one forced you to use a product that don't like for any reason.

thank you @pi0, i applreciate your answer, i wasn't really needed in immedeate answer (i could wait for weeks!) but this guy is core team member and he answering like "just delete this object" (which is bs) and closing issue. My main answer was how did they (ozon.ru) removed $nuxt object without problems. Looks like they modified 1 of nuxt modules, maybe a builder or a custom webpack config?

"free time and passion of contributing", bruh
I got telemetry enabled on every nuxt project btw - i support it too and get nothing from sponsors

@saint777 I've checked their website closely, seems they are using a custom fork. All loading-bar and internals customized. Still as mentioned and manniL mentioned, it doesn't prevent to access internals:

image

@pi0 just ban me i'll not use Issues tab again

Issue locked as already answered.

Feel free opening a new issue or dicussion if still having concerns regarding globalName. :green_heart:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vadimsg picture vadimsg  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

gary149 picture gary149  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments

uptownhr picture uptownhr  路  3Comments