Skip to content

Commit fc5f6e2

Browse files
dianaquDiana Qu
andauthored
[Script Debugging] Update For New Release 538 (#35)
* run script to copy files * modify vcx file * add script debugging support * run script on wpf * run script again to pick up the update * update to 538 prerelease version * rerun script aganit jessica's branch ready to release * rerun script on wpf * change wpf sample to use newest sdk * update winform to latest released sdk Co-authored-by: Diana Qu <[email protected]>
1 parent 258ff21 commit fc5f6e2

31 files changed

+773
-178
lines changed

WebView2APISample/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ packages/
2222
# Ignore files generated by midl
2323
/HostObjectSample_h.h
2424
/HostObjectSample_i.c
25+
26+
# Make sure script debug config is checked in for vendor testing
27+
!.vscode

WebView2APISample/.vscode/launch.json

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debugger For Microsoft Edge: Sample app (Script Debug|x64)",
6+
"type": "edge",
7+
"request": "launch",
8+
"cwd": "${workspaceFolder}",
9+
"runtimeExecutable": "${workspaceFolder}/Debug/x64/WebView2APISample.exe",
10+
"env": {
11+
// customize for your build location
12+
"Path": "%path%;${workspaceFolder}/Debug/x64"
13+
},
14+
"useWebView": true
15+
},
16+
{
17+
"name": "Debugger For Microsoft Edge: Sample app (Script Debug|x86)",
18+
"type": "edge",
19+
"request": "launch",
20+
"cwd": "${workspaceFolder}",
21+
"runtimeExecutable": "${workspaceFolder}/Debug/Win32/WebView2APISample.exe",
22+
"env": {
23+
// customize for your build location
24+
"Path": "%path%;${workspaceFolder}/Debug/Win32"
25+
},
26+
"useWebView": true
27+
},
28+
{
29+
"name": "Debugger For Microsoft Edge: Sample app (Script Debug|ARM64)",
30+
"type": "edge",
31+
"request": "launch",
32+
"cwd": "${workspaceFolder}",
33+
"runtimeExecutable": "${workspaceFolder}/Debug/arm64/WebView2APISample.exe",
34+
"env": {
35+
// customize for your build location
36+
"Path": "%path%;${workspaceFolder}/Debug/arm64"
37+
},
38+
"useWebView": true
39+
},
40+
{
41+
"name": "Debugger For Microsoft Edge: Sample app (Script Release|x64)",
42+
"type": "edge",
43+
"request": "launch",
44+
"cwd": "${workspaceFolder}",
45+
"runtimeExecutable": "${workspaceFolder}/Release/x64/WebView2APISample.exe",
46+
"env": {
47+
// customize for your build location
48+
"Path": "%path%;${workspaceFolder}/Release/x64"
49+
},
50+
"useWebView": true
51+
},
52+
{
53+
"name": "Debugger For Microsoft Edge: Sample app (Script Release|x86)",
54+
"type": "edge",
55+
"request": "launch",
56+
"cwd": "${workspaceFolder}",
57+
"runtimeExecutable": "${workspaceFolder}/Release/Win32/WebView2APISample.exe",
58+
"env": {
59+
// customize for your build location
60+
"Path": "%path%;${workspaceFolder}/Release/Win32"
61+
},
62+
"useWebView": true
63+
},
64+
{
65+
"name": "Debugger For Microsoft Edge: Sample app (Script Release|ARM64)",
66+
"type": "edge",
67+
"request": "launch",
68+
"cwd": "${workspaceFolder}",
69+
"runtimeExecutable": "${workspaceFolder}/Release/arm64/WebView2APISample.exe",
70+
"env": {
71+
// customize for your build location
72+
"Path": "%path%;${workspaceFolder}/Release/arm64"
73+
},
74+
"useWebView": true
75+
},
76+
{
77+
"name": "JavaScript Debugger(Nightly): Sample app (Script Debug|x64)",
78+
"type": "pwa-msedge",
79+
"request": "launch",
80+
"cwd": "${workspaceFolder}",
81+
"runtimeExecutable": "${workspaceFolder}/Debug/x64/WebView2APISample.exe",
82+
"env": {
83+
// customize for your build location
84+
"Path": "%path%;${workspaceFolder}/Debug/x64"
85+
},
86+
"useWebView": "true"
87+
},
88+
{
89+
"name": "JavaScript Debugger(Nightly): Sample app (Script Debug|x86)",
90+
"type": "pwa-msedge",
91+
"request": "launch",
92+
"cwd": "${workspaceFolder}",
93+
"runtimeExecutable": "${workspaceFolder}/Debug/Win32/WebView2APISample.exe",
94+
"env": {
95+
// customize for your build location
96+
"Path": "%path%;${workspaceFolder}/Debug/Win32"
97+
},
98+
"useWebView": "true"
99+
},
100+
{
101+
"name": "JavaScript Debugger(Nightly): Sample app (Script Debug|ARM64)",
102+
"type": "pwa-msedge",
103+
"request": "launch",
104+
"cwd": "${workspaceFolder}",
105+
"runtimeExecutable": "${workspaceFolder}/Debug/arm64/WebView2APISample.exe",
106+
"env": {
107+
// customize for your build location
108+
"Path": "%path%;${workspaceFolder}/Debug/arm64"
109+
},
110+
"useWebView": "true"
111+
},
112+
{
113+
"name": "JavaScript Debugger(Nightly): Sample app (Script Release|x64)",
114+
"type": "pwa-msedge",
115+
"request": "launch",
116+
"cwd": "${workspaceFolder}",
117+
"runtimeExecutable": "${workspaceFolder}/Release/x64/WebView2APISample.exe",
118+
"env": {
119+
// customize for your build location
120+
"Path": "%path%;${workspaceFolder}/Release/x64"
121+
},
122+
"useWebView": "true"
123+
},
124+
{
125+
"name": "JavaScript Debugger(Nightly): Sample app (Script Release|x86)",
126+
"type": "pwa-msedge",
127+
"request": "launch",
128+
"cwd": "${workspaceFolder}",
129+
"runtimeExecutable": "${workspaceFolder}/Release/Win32/WebView2APISample.exe",
130+
"env": {
131+
// customize for your build location
132+
"Path": "%path%;${workspaceFolder}/Release/Win32"
133+
},
134+
"useWebView": "true"
135+
},
136+
{
137+
"name": "JavaScript Debugger(Nightly): Sample app (Script Release|ARM64)",
138+
"type": "pwa-msedge",
139+
"request": "launch",
140+
"cwd": "${workspaceFolder}",
141+
"runtimeExecutable": "${workspaceFolder}/Release/arm64/WebView2APISample.exe",
142+
"env": {
143+
// customize for your build location
144+
"Path": "%path%;${workspaceFolder}/Release/arm64"
145+
},
146+
"useWebView": "true"
147+
},
148+
{
149+
"name": "Debugger For Microsoft Edge: Attach to Edge",
150+
"type": "edge",
151+
"port": 9222,
152+
"request": "attach",
153+
"webRoot": "${workspaceFolder}"
154+
},
155+
{
156+
"name": "JavaScript Debugger(Nightly): Attach to Edge",
157+
"type": "pwa-msedge",
158+
"port": 9222,
159+
"request": "attach",
160+
"webRoot": "${workspaceFolder}"
161+
},
162+
{
163+
"name": "Sample app (debug app)",
164+
"type": "cppvsdbg",
165+
"request": "launch",
166+
"program": "${workspaceFolder}/Debug/x64/WebView2APISample.exe",
167+
"args": [],
168+
"preLaunchTask": "",
169+
"stopAtEntry": false,
170+
"cwd": "${workspaceFolder}",
171+
"environment": [],
172+
"externalConsole": true
173+
},
174+
{
175+
"name": "Sample app (debug webview)",
176+
"type": "cppvsdbg",
177+
"request": "attach",
178+
"processId": "${command:pickProcess}"
179+
}
180+
]
181+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"files.associations": {
3+
"cctype": "cpp",
4+
"concepts": "cpp",
5+
"cstddef": "cpp",
6+
"cstdint": "cpp",
7+
"cstdio": "cpp",
8+
"cstdlib": "cpp",
9+
"cstring": "cpp",
10+
"cwchar": "cpp",
11+
"exception": "cpp",
12+
"initializer_list": "cpp",
13+
"iosfwd": "cpp",
14+
"limits": "cpp",
15+
"new": "cpp",
16+
"string": "cpp",
17+
"tuple": "cpp",
18+
"type_traits": "cpp",
19+
"utility": "cpp",
20+
"xmemory": "cpp",
21+
"xstddef": "cpp",
22+
"xstring": "cpp",
23+
"xtr1common": "cpp",
24+
"xutility": "cpp",
25+
"algorithm": "cpp",
26+
"filesystem": "cpp",
27+
"chrono": "cpp",
28+
"cmath": "cpp",
29+
"codecvt": "cpp",
30+
"ctime": "cpp",
31+
"iomanip": "cpp",
32+
"ios": "cpp",
33+
"istream": "cpp",
34+
"list": "cpp",
35+
"locale": "cpp",
36+
"memory": "cpp",
37+
"ostream": "cpp",
38+
"ratio": "cpp",
39+
"stdexcept": "cpp",
40+
"streambuf": "cpp",
41+
"system_error": "cpp",
42+
"typeinfo": "cpp",
43+
"vector": "cpp",
44+
"xfacet": "cpp",
45+
"xiosbase": "cpp",
46+
"xlocale": "cpp",
47+
"xlocbuf": "cpp",
48+
"xlocinfo": "cpp",
49+
"xlocmes": "cpp",
50+
"xlocmon": "cpp",
51+
"xlocnum": "cpp",
52+
"xloctime": "cpp",
53+
"deque": "cpp",
54+
"fstream": "cpp",
55+
"functional": "cpp",
56+
"iostream": "cpp",
57+
"iterator": "cpp",
58+
"map": "cpp",
59+
"mutex": "cpp",
60+
"queue": "cpp",
61+
"random": "cpp",
62+
"set": "cpp",
63+
"sstream": "cpp",
64+
"stack": "cpp",
65+
"thread": "cpp",
66+
"unordered_map": "cpp",
67+
"unordered_set": "cpp",
68+
"xhash": "cpp",
69+
"xtree": "cpp",
70+
"array": "cpp",
71+
"atomic": "cpp",
72+
"clocale": "cpp",
73+
"condition_variable": "cpp",
74+
"optional": "cpp",
75+
"regex": "cpp",
76+
"shared_mutex": "cpp",
77+
"strstream": "cpp"
78+
},
79+
"debug.node.useV3": true,
80+
"debug.chrome.useV3": true
81+
}

WebView2APISample/App.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
#include <shobjidl.h>
1212
#include <string.h>
1313
#include <vector>
14-
1514
#include "AppWindow.h"
1615

1716
HINSTANCE g_hInstance;
1817
int g_nCmdShow;
1918
bool g_autoTabHandle = true;
20-
2119
static std::map<DWORD, HANDLE> s_threads;
2220

2321
static int RunMessagePump();
@@ -41,7 +39,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
4139
PROCESS_DPI_AWARENESS oldDpiAwareness = PROCESS_PER_MONITOR_DPI_AWARE;
4240
std::wstring appId(L"EBWebView.SampleApp");
4341
std::wstring initialUri(L"https://www.bing.com");
44-
4542
if (lpCmdLine && lpCmdLine[0])
4643
{
4744
bool commandLineError = false;
@@ -104,7 +101,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
104101
}
105102
else
106103
{
107-
// --edge-webview-switches is a supported switch to pass addtional
104+
// --edge-webview-switches is a supported switch to pass additional
108105
// command line switches to WebView's browser process.
109106
// For example, adding
110107
// --edge-webview-switches="--remote-debugging-port=9222"
@@ -213,12 +210,11 @@ static int RunMessagePump()
213210
void CreateNewThread(UINT creationModeId)
214211
{
215212
DWORD threadId;
216-
HANDLE thread = CreateThread(nullptr, 0, ThreadProc,
217-
reinterpret_cast<LPVOID>(creationModeId),
213+
HANDLE thread = CreateThread(
214+
nullptr, 0, ThreadProc, reinterpret_cast<LPVOID>(creationModeId),
218215
STACK_SIZE_PARAM_IS_A_RESERVATION, &threadId);
219216
s_threads.insert(std::pair<DWORD, HANDLE>(threadId, thread));
220217
}
221-
222218
// This function is the starting point for new threads. It will open a new app window.
223219
static DWORD WINAPI ThreadProc(void* pvParam)
224220
{

WebView2APISample/App.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// found in the LICENSE file.
44

55
#include "stdafx.h"
6+
#include <string>
67

78
extern HINSTANCE g_hInstance;
89
extern int g_nCmdShow;
910
extern bool g_autoTabHandle;
10-
1111
void CreateNewThread(UINT creationModeId);

0 commit comments

Comments
 (0)