Skip to content

Commit 800e190

Browse files
committed
chore: improve dev shell
1 parent d153aa6 commit 800e190

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

packages/shell-host/src/DevIframe.vue

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ export default defineComponent({
9595
src.value = 'target.html'
9696
}
9797
98+
const includeCode = `<script src="${location.origin}/target/hook.js"></script>`
99+
98100
return {
99101
src,
100102
url,
@@ -104,6 +106,7 @@ export default defineComponent({
104106
onLoad,
105107
reset,
106108
error,
109+
includeCode,
107110
}
108111
},
109112
})
@@ -149,19 +152,48 @@ export default defineComponent({
149152
class="icon-button flat"
150153
@click="reset()"
151154
/>
155+
156+
<VueDropdown
157+
:offset="[0, 0]"
158+
>
159+
<template #trigger>
160+
<VueButton
161+
v-tooltip="'Help'"
162+
icon-left="help"
163+
class="icon-button flat"
164+
/>
165+
</template>
166+
167+
<div class="p-8">
168+
<p>
169+
You need to <a
170+
href="https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome"
171+
target="_blank"
172+
class="text-green-500"
173+
>disable Chrome web security</a> to allow manipulating an iframe on a different origin.
174+
</p>
175+
<pre class="my-2 p-2 rounded bg-gray-100 dark:bg-gray-900 text-sm">google-chrome --disable-web-security --user-data-dir="temp-chrome-data"</pre>
176+
<p>If the devtools have trouble connecting to the webpage, please put this snippet in the target app HTML before the main scripts:</p>
177+
<pre
178+
class="my-2 p-2 rounded bg-gray-100 dark:bg-gray-900 text-sm"
179+
v-html="includeCode"
180+
/>
181+
</div>
182+
</VueDropdown>
152183
</div>
153184

154185
<VueModal
155186
v-if="error"
156187
title="Error"
157188
@close="error = false"
158189
>
159-
<div class="p-8">
190+
<div class="p-6">
160191
Please <a
161192
href="https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome"
162193
target="_blank"
163194
class="text-green-500"
164195
>disable Chrome web security</a> to allow manipulating an iframe on a different origin.
196+
<pre class="my-2 p-2 rounded bg-gray-100 dark:bg-gray-900 text-sm">google-chrome --disable-web-security --user-data-dir="temp-chrome-data"</pre>
165197
</div>
166198
</VueModal>
167199
</div>

tailwind.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ module.exports = {
9898
path.resolve(__dirname, './packages/app-backend-vue2/src/**/*.{js,jsx,ts,tsx,vue}'),
9999
path.resolve(__dirname, './packages/app-backend-vue3/src/**/*.{js,jsx,ts,tsx,vue}'),
100100
path.resolve(__dirname, './packages/shared-utils/src/**/*.{js,jsx,ts,tsx,vue}'),
101+
path.resolve(__dirname, './packages/shell-host/src/**/*.{js,jsx,ts,tsx,vue}'),
101102
],
102103
},
103104
}

0 commit comments

Comments
 (0)