Skip to content
This repository was archived by the owner on Dec 6, 2022. It is now read-only.

Commit 7c1865b

Browse files
committed
Revert incomplete PR #623
1 parent 2d573e3 commit 7c1865b

6 files changed

Lines changed: 7 additions & 21 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ See our wiki page for some configured example apps: [Examples](https://github.co
135135
* `userDataDir`: Normally, if Chrome is already running when you start debugging with a launch config, then the new instance won't start in remote debugging mode. So by default, the extension launches Chrome with a separate user profile in a temp folder. Use this option to set a different path to use, or set to false to launch with your default user profile.
136136
* `url`: On a 'launch' config, it will launch Chrome at this URL.
137137
* `urlFilter`: On an 'attach' config, or a 'launch' config with no 'url' set, search for a page with this url and attach to it. It can also contain wildcards, for example, `"localhost:*/app"` will match either `"http://localhost:123/app"` or `"http://localhost:456/app"`, but not `"https://stackoverflow.com"`.
138-
* `targetTypes`: On an 'attach' config, or a 'launch' config with no 'url' set, search for a target with one of provided types. Possible target path in Chrome are `page`, `iframe`, `shared_worker`, `service_worker`, `browser`, `webview` and `other`. By default equals to `['page']`.
139138
* `sourceMaps`: By default, the adapter will use sourcemaps and your original sources whenever possible. You can disable this by setting `sourceMaps` to false.
140139
* `pathMapping`: This property takes a mapping of URL paths to local paths, to give you more flexibility in how URLs are resolved to local files. `"webRoot": "${workspaceFolder}"` is just shorthand for a pathMapping like `{ "/": "${workspaceFolder}" }`.
141140
* `smartStep`: Automatically steps over code that doesn't map to source files. Especially useful for debugging with async/await.

package.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,6 @@
264264
"description": "%chrome.urlFilter.description%",
265265
"default": ""
266266
},
267-
"targetTypes": {
268-
"type": "array",
269-
"description": "%chrome.targetTypes.description%",
270-
"default": [
271-
"page"
272-
]
273-
},
274267
"showAsyncStacks": {
275268
"type": "boolean",
276269
"description": "%chrome.showAsyncStacks.description%",

package.nls.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"chrome.timeout.description": "Retry for this number of milliseconds to connect to Chrome. Default is 10000 ms.",
2626
"chrome.disableNetworkCache.description": "Controls whether to skip the network cache for each request",
2727
"chrome.urlFilter.description": "Will search for a page with this url and attach to it, if found. Can have * wildcards.",
28-
"chrome.targetTypes.description": "Will search for a target with one of these runtime types. Defaults to ['page'].",
2928
"chrome.showAsyncStacks.description": "Show the async calls that led to the current call stack",
3029
"chrome.breakOnLoad.description": "Experimental feature - If true, the debug adapter will attempt to set breakpoints in scripts before they are loaded, so it can hit breakpoints at the beginnings of those scripts. Has a perf impact.",
3130
"chrome.breakOnLoadStrategy.description": "The strategy to use for breakOnLoad.",

src/chromeDebug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { ChromeDebugSession, logger, UrlPathTransformer, BaseSourceMapTransformer, telemetry } from 'vscode-chrome-debug-core';
66
import * as path from 'path';
77
import * as os from 'os';
8-
import { targetFilterProvider } from './utils';
8+
import { targetFilter } from './utils';
99

1010
import { ChromeDebugAdapter } from './chromeDebugAdapter';
1111

@@ -18,7 +18,7 @@ ChromeDebugSession.run(ChromeDebugSession.getSession(
1818
adapter: ChromeDebugAdapter,
1919
extensionName: EXTENSION_NAME,
2020
logFilePath: path.resolve(os.tmpdir(), 'vscode-chrome-debug.txt'),
21-
targetFilter: targetFilterProvider(),
21+
targetFilter,
2222

2323
pathTransformer: UrlPathTransformer,
2424
sourceMapTransformer: BaseSourceMapTransformer,

src/extension.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import * as vscode from 'vscode';
66
import * as Core from 'vscode-chrome-debug-core';
77

8-
import { targetFilterProvider } from './utils';
8+
import { targetFilter } from './utils';
99

1010
import * as nls from 'vscode-nls';
1111
const localize = nls.loadMessageBundle();
@@ -50,11 +50,7 @@ export class ChromeConfigurationProvider implements vscode.DebugConfigurationPro
5050

5151
let targets;
5252
try {
53-
targets = await discovery.getAllTargets(
54-
config.address || '127.0.0.1',
55-
config.port,
56-
targetFilterProvider(config.targetTypes),
57-
config.url || config.urlFilter);
53+
targets = await discovery.getAllTargets(config.address || '127.0.0.1', config.port, targetFilter, config.url || config.urlFilter);
5854
} catch (e) {
5955
// Target not running?
6056
}
@@ -115,4 +111,4 @@ function unescapeTargetTitle(title: string): string {
115111
.replace(/>/g, '>')
116112
.replace(/'/g, `'`)
117113
.replace(/"/g, '"');
118-
}
114+
}

src/utils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,5 @@ export class DebounceHelper {
6464
}
6565
}
6666

67-
export const targetFilterProvider =
68-
(types: Iterable<string> = ['page']): chromeConnection.ITargetFilter =>
69-
target => target && (!target.type || Array.from(types).some(t => t === target.type));
67+
export const targetFilter: chromeConnection.ITargetFilter =
68+
target => target && (!target.type || target.type === 'page');

0 commit comments

Comments
 (0)