Skip to content

Commit 5360cf4

Browse files
authored
fix(pip): check for https support (#522)
1 parent acb8725 commit 5360cf4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/devtools/client/components/PictureInPictureButton.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
const client = useClient()
33
44
const isInPopup = window.__NUXT_DEVTOOLS_IS_POPUP__
5+
const isHttps = computed(() => window.location.protocol === 'https:')
56
67
const showInfo = ref(false)
78
const copy = useCopy()
@@ -17,7 +18,7 @@ function popup() {
1718

1819
<template>
1920
<template v-if="!isInPopup">
20-
<NButton v-if="client?.devtools.popup" n="sm primary" @click="popup()">
21+
<NButton v-if="client?.devtools.popup && isHttps" n="sm primary" @click="popup()">
2122
<div carbon-launch /> Popup
2223
</NButton>
2324
<template v-else>
@@ -45,6 +46,12 @@ function popup() {
4546
</NButton>
4647
and restart the browser.
4748
</p>
49+
<NTip v-if="!isHttps" class="mb-4" n="orange">
50+
Please note that the popup feature only works when your server is running under HTTPS.
51+
<NuxtLink to="https://nuxt.com/docs/api/nuxt-config#https" target="_blank">
52+
Learn how to run your server with https on Nuxt's Documentation
53+
</NuxtLink>
54+
</NTip>
4855
<div>
4956
<NButton @click="showInfo = false">
5057
Close

packages/devtools/client/components/PictureInPictureInfoDialog.vue

Whitespace-only changes.

0 commit comments

Comments
 (0)