Skip to content

Commit cb013cc

Browse files
committed
feat(backend): on page config, closes #1440
1 parent 7459947 commit cb013cc

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/app-backend-core/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { registerApp, selectApp, waitForAppsRegistration, sendApps, _legacy_getA
3434
import { sendInspectorTree, getInspector, getInspectorWithAppId, sendInspectorState, editInspectorState, sendCustomInspectors } from './inspector'
3535
import { showScreenshot } from './timeline-screenshot'
3636
import { handleAddPerformanceTag, performanceMarkEnd, performanceMarkStart } from './perf'
37+
import { initOnPageConfig } from './page-config'
3738

3839
let ctx: BackendContext
3940
let connected = false
@@ -50,6 +51,8 @@ export async function initBackend (bridge: Bridge) {
5051
persist: false
5152
})
5253

54+
initOnPageConfig()
55+
5356
if (hook.Vue) {
5457
connect()
5558
_legacy_getAndRegisterApps(hook.Vue, ctx)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { target } from '@vue-devtools/shared-utils'
2+
import SharedData from '@vue-devtools/shared-utils/lib/shared-data'
3+
4+
export function initOnPageConfig () {
5+
// User project devtools config
6+
if (Object.hasOwnProperty.call(target, 'VUE_DEVTOOLS_CONFIG')) {
7+
const config = target.VUE_DEVTOOLS_CONFIG
8+
9+
// Open in editor
10+
if (Object.hasOwnProperty.call(config, 'openInEditorHost')) {
11+
SharedData.openInEditorHost = config.openInEditorHost
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)