Skip to content

Commit 3c00b45

Browse files
emanuelmutschlechnerGuillaume Chau
authored andcommitted
feat: Add a setting for "vue-devtools Detected Vue" console log, closes vuejs#685 (vuejs#811)
* feat: Add a setting for "vue-devtools Detected Vue" console log, closes vuejs#685 * Fix check for cold storage * fix: use SharedData * refactor: invert setting Co-authored-by: Guillaume Chau <alphadelta.fg@gmail.com>
1 parent f46c608 commit 3c00b45

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

src/backend/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,14 @@ function connect (Vue) {
153153

154154
bridge.log('backend ready.')
155155
bridge.send('ready', Vue.version)
156-
console.log(
157-
`%c vue-devtools %c Detected Vue v${Vue.version} %c`,
158-
'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
159-
'background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff',
160-
'background:transparent'
161-
)
156+
if (SharedData.logDetected) {
157+
console.log(
158+
`%c vue-devtools %c Detected Vue v${Vue.version} %c`,
159+
'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
160+
'background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff',
161+
'background:transparent'
162+
)
163+
}
162164

163165
setTimeout(() => {
164166
scan()

src/devtools/views/settings/GlobalPreferences.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@
6767
Enable <span class="dim">(may print warnings)</span>
6868
</VueSwitch>
6969
</VueFormField>
70+
71+
<VueFormField title="Detected Vue message">
72+
<VueSwitch
73+
:value="$shared.logDetected"
74+
@input="$shared.logDetected = $event"
75+
>
76+
Display in browser console
77+
</VueSwitch>
78+
</VueFormField>
7079
</div>
7180
</template>
7281

src/shared-data.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ const internalSharedData = {
1111
cacheVuexSnapshotsLimit: 10,
1212
snapshotLoading: null,
1313
recordPerf: false,
14-
editableProps: false
14+
editableProps: false,
15+
logDetected: true
1516
}
1617

1718
const persisted = [
1819
'classifyComponents',
1920
'theme',
2021
'displayDensity',
2122
'recordVuex',
22-
'editableProps'
23+
'editableProps',
24+
'logDetected'
2325
]
2426

2527
// ---- INTERNALS ---- //

0 commit comments

Comments
 (0)