Skip to content

Commit 4f7eff6

Browse files
committed
chore(extension): remove unused permission
1 parent f7d0165 commit 4f7eff6

File tree

5 files changed

+2
-187
lines changed

5 files changed

+2
-187
lines changed

packages/chrome-extension/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
"manifest_version": 3,
4949
"name": "Vue.js DevTools",
5050
"permissions": [
51-
"scripting",
52-
"storage"
51+
"scripting"
5352
],
5453
"version": "7.0.0.1",
5554
"version_name": "7.0.0 beta 1",

packages/chrome-extension/src/devtools-overlay.ts

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -14,73 +14,3 @@ window.addEventListener('message', (event) => {
1414
chrome.runtime.sendMessage(event.data.data)
1515
}
1616
}, false)
17-
18-
// function init() {
19-
// const body = document.getElementsByTagName('body')[0]
20-
// const head = document.getElementsByTagName('head')[0]
21-
22-
// // create overlay link stylesheet
23-
// const link = document.createElement('link')
24-
// link.rel = 'stylesheet'
25-
// link.href = chrome.runtime.getURL('../overlay/devtools-overlay.css')
26-
27-
// // create overlay script
28-
// const script = document.createElement('script')
29-
// script.src = chrome.runtime.getURL('../overlay/devtools-overlay.js')
30-
// head.appendChild(link)
31-
// link.onload = () => {
32-
// // append overlay to body
33-
// body.appendChild(script)
34-
// }
35-
36-
// // inject devtools client url variable
37-
// // de-depulicate
38-
// if (head.querySelector('meta[name="__VUE_DEVTOOLS_CLIENT_URL__"]'))
39-
// return
40-
41-
// const meta = document.createElement('meta')
42-
// meta.setAttribute('name', '__VUE_DEVTOOLS_CLIENT_URL__')
43-
// meta.setAttribute('content', clientUrl)
44-
// head.appendChild(meta)
45-
// }
46-
47-
// function toggleViewMode(mode: 'overlay' | 'panel') {
48-
// window.postMessage({
49-
// source: '__VUE_DEVTOOLS_OVERLAY__',
50-
// payload: {
51-
// event: 'toggle-view-mode',
52-
// data: mode,
53-
// },
54-
// }, '*')
55-
// }
56-
57-
// window.addEventListener('message', async (e) => {
58-
// if (e.source === window && e.data.vueDetected) {
59-
// await chrome.storage.local.set({ [VITE_PLUGIN_DETECTED_STORAGE_KEY]: e.data.vitePluginDetected, [VITE_PLUGIN_CLIENT_URL_STORAGE_KEY]: e.data.vitePluginClientUrl })
60-
// if (e.data.vitePluginDetected)
61-
// return
62-
// chrome.runtime.sendMessage(e.data)
63-
// const storage = await chrome.storage.local.get(VIEW_MODE_STORAGE_KEY)
64-
// const viewMode = storage[VIEW_MODE_STORAGE_KEY] ?? 'overlay'
65-
// const data = e.data
66-
// if (data.devtoolsEnabled && viewMode === 'overlay')
67-
// init()
68-
// }
69-
// else if (e.data.source === '__VUE_DEVTOOLS_PROXY__' && e.data.payload.event === 'toggle-view-mode') {
70-
// if (e.data.payload.data === 'panel') {
71-
// toggleViewMode('panel')
72-
// }
73-
74-
// else {
75-
// const link = document.querySelector('link[href^="chrome-extension://"][href*="/devtools-overlay.css"]')
76-
// const script = document.querySelector('script[src^="chrome-extension://"][src*="/devtools-overlay.js"]')
77-
78-
// // init
79-
// if (!link || !script)
80-
// init()
81-
// // restore
82-
// else
83-
// toggleViewMode('overlay')
84-
// }
85-
// }
86-
// })

packages/chrome-extension/src/devtools-panel.ts

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -75,93 +75,3 @@ function injectScript(scriptName: string, cb: () => void) {
7575
cb()
7676
})
7777
}
78-
79-
// chrome.storage.local.get([VITE_PLUGIN_DETECTED_STORAGE_KEY, VITE_PLUGIN_CLIENT_URL_STORAGE_KEY]).then((storage) => {
80-
// const vitePluginDetected = storage[VITE_PLUGIN_DETECTED_STORAGE_KEY]
81-
// const vitePluginClientUrl = storage[VITE_PLUGIN_CLIENT_URL_STORAGE_KEY]
82-
// // for vite plugin
83-
// if (vitePluginDetected) {
84-
// function init(iframe: HTMLIFrameElement) {
85-
// if (chrome.runtime?.id === undefined)
86-
// return
87-
// injectScript(chrome.runtime.getURL('dist/user-app.js'), () => {
88-
// connect()
89-
90-
// // proxy user app messaging
91-
// function onPortMessage(data) {
92-
// if (connectionInfo.disconnected)
93-
// return
94-
// iframe?.contentWindow?.postMessage({
95-
// source: '__VUE_DEVTOOLS_USER_APP__',
96-
// data,
97-
// }, '*')
98-
// }
99-
// connectionInfo.port!.onMessage.addListener(onPortMessage)
100-
101-
// // proxy devtools client messaging
102-
// function onIframeMessage(e) {
103-
// if (connectionInfo.disconnected)
104-
// return
105-
// if (e.data.source === '__VUE_DEVTOOLS_CLIENT__')
106-
// connectionInfo.port?.postMessage(e.data.data)
107-
// }
108-
// window.addEventListener('message', onIframeMessage)
109-
110-
// iframe?.contentWindow?.postMessage('__VUE_DEVTOOLS_CREATE_CLIENT__', '*')
111-
112-
// function cleanup() {
113-
// connectionInfo.port!.onMessage.removeListener(onPortMessage)
114-
// window.removeEventListener('message', onIframeMessage)
115-
// chrome.devtools.network.onNavigated.removeListener(cleanup)
116-
// init(iframe)
117-
// }
118-
// chrome.devtools.network.onNavigated.addListener(cleanup)
119-
// })
120-
// }
121-
122-
// function createClient() {
123-
// const iframe = document.createElement('iframe')
124-
// iframe.src = vitePluginClientUrl
125-
// iframe.style.border = 'none'
126-
// iframe.style.width = '100vw'
127-
// iframe.style.height = '100vh'
128-
// document.getElementById('app')!.appendChild(iframe)
129-
// iframe.onload = () => {
130-
// init(iframe)
131-
// }
132-
// }
133-
134-
// createClient()
135-
// }
136-
// // for browser extension
137-
// else {
138-
// // initDevTools({
139-
// // connect(cb) {
140-
// // if (chrome.runtime?.id === undefined)
141-
// // return
142-
// // injectScript(chrome.runtime.getURL('dist/user-app.js'), () => {
143-
// // // connect to background to setup proxy
144-
// // connect()
145-
146-
// // const bridge = new Bridge({
147-
// // tracker(fn: any) {
148-
// // connectionInfo.port.onMessage.addListener(fn)
149-
// // connectionInfo.listeners.push(fn)
150-
// // },
151-
// // trigger(data) {
152-
// // if (connectionInfo.disconnected)
153-
// // return
154-
155-
// // connectionInfo.port?.postMessage(data)
156-
// // },
157-
// // })
158-
159-
// // cb(bridge)
160-
// // })
161-
// // },
162-
// // reload(fn) {
163-
// // chrome.devtools.network.onNavigated.addListener(fn)
164-
// // },
165-
// // })
166-
// }
167-
// })
Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +0,0 @@
1-
// import { VIEW_MODE_STORAGE_KEY, isInChromePanel, target } from '@vue/devtools-shared'
2-
// import { useDevToolsBridge } from '@vue/devtools-core'
3-
4-
// export function useToggleViewMode() {
5-
// const bridge = useDevToolsBridge()
6-
// const viewMode = ref('')
7-
8-
// if (isInChromePanel) {
9-
// target.chrome.storage.local.get(VIEW_MODE_STORAGE_KEY).then((storage) => {
10-
// viewMode.value = storage[VIEW_MODE_STORAGE_KEY] ?? 'overlay'
11-
// })
12-
// }
13-
14-
// return {
15-
// viewMode,
16-
// toggle(value: 'overlay' | 'panel') {
17-
// viewMode.value = value
18-
// target.chrome.storage.local.set({ [VIEW_MODE_STORAGE_KEY]: value })
19-
// if (isInChromePanel)
20-
// bridge.value.emit('toggle-view-mode', value)
21-
// },
22-
// }
23-
// }

packages/firefox-extension/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
"manifest_version": 2,
4646
"name": "Vue.js DevTools",
4747
"permissions": [
48-
"<all_urls>",
49-
"storage"
48+
"<all_urls>"
5049
],
5150
"version": "7.0.0.1",
5251
"version_name": "7.0.0 beta 1",

0 commit comments

Comments
 (0)