Skip to content

Commit c43500a

Browse files
authored
feat: enable picture in picture for localhost (#627)
1 parent 8937b78 commit c43500a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/devtools/client/components/PictureInPictureButton.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const client = useClient()
33
44
const isInPopup = window.__NUXT_DEVTOOLS_IS_POPUP__
5-
const isHttps = computed(() => window.location.protocol === 'https:')
5+
const isSecureContext = computed(() => window.isSecureContext)
66
77
const showInfo = ref(false)
88
const copy = useCopy()
@@ -18,7 +18,7 @@ function popup() {
1818

1919
<template>
2020
<template v-if="!isInPopup">
21-
<NButton v-if="client?.devtools.popup && isHttps" n="sm primary" @click="popup()">
21+
<NButton v-if="client?.devtools.popup && isSecureContext" n="sm primary" @click="popup()">
2222
<div carbon-launch /> Popup
2323
</NButton>
2424
<template v-else>
@@ -46,7 +46,7 @@ function popup() {
4646
</NButton>
4747
and restart the browser.
4848
</p>
49-
<NTip v-if="!isHttps" class="mb-4" n="orange">
49+
<NTip v-if="!isSecureContext" class="mb-4" n="orange">
5050
Please note that the popup feature only works when your server is running under HTTPS.
5151
<NuxtLink to="https://nuxt.com/docs/api/nuxt-config#https" target="_blank">
5252
Learn how to run your server with https on Nuxt's Documentation

0 commit comments

Comments
 (0)