Skip to content

Commit 6472015

Browse files
authored
Experimental Firefox Support (#1640)
* Revision info + process states refactor * Some progress * progress * feature complete * CodeFactor * restore framework change * Update demo * BrowserFetcher doesn't like single threads * update screenshots * Update worker test * Update tests * Fix tests with lastest browser * Some improvements * Fix windows * Bump firefox version * BackendNodeId should be string * backendNodeId as object * fix accessibility * Fix linux deploy * Update goldens * Add missing golden * ignore some tests add CI config * Ignore more tests * Fix launch tests * code factor * Skip network conditions in firefox * Add missing using * Remove missing test in upstream * double global timeout * Ignore wait for navigation test * Ignore more tests * Remove parallel threads * change settings * Remove windows tests We have lots of zombies * Remove moz env variable * Remove CHROMIUM env variable
1 parent 5be4fdb commit 6472015

File tree

242 files changed

+2257
-1783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+2257
-1783
lines changed

appveyor-edge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 1.0.{build}
22
branches:
33
only:
4-
- master
4+
- disabled
55
image: Visual Studio 2019
66
configuration: Release
77
environment:

appveyor-linux.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ branches:
55
image: ubuntu1804
66
configuration: Release
77
environment:
8+
MOZ_WEBRENDER: 0
89
git_access_token:
910
secure: FxcQ9C8a/NgcQB5dFdZts6ZWEDT4zMhA4qPQAYwWc7huMmhmTIl1sbFEIaAWQMTL
1011
matrix:
1112
- framework: netcoreapp2.2
13+
PRODUCT: CHROMIUM
14+
- framework: netcoreapp2.2
15+
PRODUCT: FIREFOX
1216

1317
before_build:
1418
- sh: >-

appveyor.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ environment:
1414
ENQUEUE_ASYNC_MESSAGES: true
1515
- framework: netcoreapp2.2
1616
ENQUEUE_ASYNC_MESSAGES: true
17-
- framework: net48
18-
ENQUEUE_ASYNC_MESSAGES: false
19-
- framework: netcoreapp2.2
20-
ENQUEUE_ASYNC_MESSAGES: false
2117
install:
2218
- ps: >-
2319
if($env:APPVEYOR_REPO_TAG -eq 'True' -And $env:framework -eq 'netcoreapp2.0') {

demos/PuppeteerSharpPdfDemo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static async Task Main(string[] args)
1616
};
1717

1818
Console.WriteLine("Downloading chromium");
19-
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);
19+
await new BrowserFetcher().DownloadAsync();
2020

2121
Console.WriteLine("Navigating google");
2222
using (var browser = await Puppeteer.LaunchAsync(options))

lib/PuppeteerSharp.DevicesFetcher/Program.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class Program
1515
{
1616
const string DEVICES_URL = "https://raw.githubusercontent.com/ChromeDevTools/devtools-frontend/master/front_end/emulated_devices/module.json";
1717

18-
static string deviceDescriptorsOutput = "../../../../PuppeteerSharp/Mobile/DeviceDescriptors.cs";
19-
static string deviceDescriptorNameOutput = "../../../../PuppeteerSharp/Mobile/DeviceDescriptorName.cs";
18+
static readonly string deviceDescriptorsOutput = "../../../../PuppeteerSharp/Mobile/DeviceDescriptors.cs";
19+
static readonly string deviceDescriptorNameOutput = "../../../../PuppeteerSharp/Mobile/DeviceDescriptorName.cs";
2020

2121
static async Task Main(string[] args)
2222
{
@@ -28,7 +28,8 @@ static async Task Main(string[] args)
2828

2929
string chromeVersion = null;
3030
var fetcher = new BrowserFetcher();
31-
await fetcher.DownloadAsync(BrowserFetcher.DefaultRevision);
31+
32+
await fetcher.DownloadAsync();
3233
await using (var browser = await Puppeteer.LaunchAsync(new LaunchOptions()))
3334
{
3435
chromeVersion = (await browser.GetVersionAsync()).Split('/').Last();

lib/PuppeteerSharp.TestServer/SimpleServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ private static bool Authenticate(string username, string password, HttpContext c
139139
string authHeader = context.Request.Headers["Authorization"];
140140
if (authHeader != null && authHeader.StartsWith("Basic", StringComparison.Ordinal))
141141
{
142-
string encodedUsernamePassword = authHeader.Substring("Basic ".Length).Trim();
142+
var encodedUsernamePassword = authHeader.Substring("Basic ".Length).Trim();
143143
var encoding = Encoding.GetEncoding("iso-8859-1");
144-
string auth = encoding.GetString(Convert.FromBase64String(encodedUsernamePassword));
144+
var auth = encoding.GetString(Convert.FromBase64String(encodedUsernamePassword));
145145

146146
return auth == $"{username}:{password}";
147147
}
70 Bytes
Binary file not shown.

lib/PuppeteerSharp.TestServer/wwwroot/input/mouse-helper.js

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This injects a box into the page that moves with the mouse;
22
// Useful for debugging
3-
(function(){
3+
(function () {
44
const box = document.createElement('div');
55
box.classList.add('mouse-helper');
66
const styleElement = document.createElement('style');
@@ -42,19 +42,31 @@
4242
`;
4343
document.head.appendChild(styleElement);
4444
document.body.appendChild(box);
45-
document.addEventListener('mousemove', event => {
46-
box.style.left = event.pageX + 'px';
47-
box.style.top = event.pageY + 'px';
48-
updateButtons(event.buttons);
49-
}, true);
50-
document.addEventListener('mousedown', event => {
51-
updateButtons(event.buttons);
52-
box.classList.add('button-' + event.which);
53-
}, true);
54-
document.addEventListener('mouseup', event => {
55-
updateButtons(event.buttons);
56-
box.classList.remove('button-' + event.which);
57-
}, true);
45+
document.addEventListener(
46+
'mousemove',
47+
(event) => {
48+
box.style.left = event.pageX + 'px';
49+
box.style.top = event.pageY + 'px';
50+
updateButtons(event.buttons);
51+
},
52+
true
53+
);
54+
document.addEventListener(
55+
'mousedown',
56+
(event) => {
57+
updateButtons(event.buttons);
58+
box.classList.add('button-' + event.which);
59+
},
60+
true
61+
);
62+
document.addEventListener(
63+
'mouseup',
64+
(event) => {
65+
updateButtons(event.buttons);
66+
box.classList.remove('button-' + event.which);
67+
},
68+
true
69+
);
5870
function updateButtons(buttons) {
5971
for (let i = 0; i < 5; i++)
6072
box.classList.toggle('button-' + i, buttons & (1 << i));

lib/PuppeteerSharp.TestServer/wwwroot/input/textarea.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<textarea></textarea>
88
<script src='mouse-helper.js'></script>
99
<script>
10-
window.result = '';
11-
let textarea = document.querySelector('textarea');
10+
globalThis.result = '';
11+
globalThis.textarea = document.querySelector('textarea');
1212
textarea.addEventListener('input', () => result = textarea.value, false);
1313
</script>
1414
</body>
15-
</html>
15+
</html>
Lines changed: 66 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,65 @@
1+
<!DOCTYPE html>
12
<style>
2-
button {
3-
position: absolute;
4-
width: 100px;
5-
height: 20px;
6-
}
7-
8-
#btn0 { right: 0px; top: 0; }
9-
#btn1 { right: -10px; top: 25px; }
10-
#btn2 { right: -20px; top: 50px; }
11-
#btn3 { right: -30px; top: 75px; }
12-
#btn4 { right: -40px; top: 100px; }
13-
#btn5 { right: -50px; top: 125px; }
14-
#btn6 { right: -60px; top: 150px; }
15-
#btn7 { right: -70px; top: 175px; }
16-
#btn8 { right: -80px; top: 200px; }
17-
#btn9 { right: -90px; top: 225px; }
18-
#btn10 { right: -100px; top: 250px; }
3+
button {
4+
position: absolute;
5+
width: 100px;
6+
height: 20px;
7+
}
8+
9+
#btn0 {
10+
right: 0px;
11+
top: 0;
12+
}
13+
14+
#btn1 {
15+
right: -10px;
16+
top: 25px;
17+
}
18+
19+
#btn2 {
20+
right: -20px;
21+
top: 50px;
22+
}
23+
24+
#btn3 {
25+
right: -30px;
26+
top: 75px;
27+
}
28+
29+
#btn4 {
30+
right: -40px;
31+
top: 100px;
32+
}
33+
34+
#btn5 {
35+
right: -50px;
36+
top: 125px;
37+
}
38+
39+
#btn6 {
40+
right: -60px;
41+
top: 150px;
42+
}
43+
44+
#btn7 {
45+
right: -70px;
46+
top: 175px;
47+
}
48+
49+
#btn8 {
50+
right: -80px;
51+
top: 200px;
52+
}
53+
54+
#btn9 {
55+
right: -90px;
56+
top: 225px;
57+
}
58+
59+
#btn10 {
60+
right: -100px;
61+
top: 250px;
62+
}
1963
</style>
2064
<button id=btn0>0</button>
2165
<button id=btn1>1</button>
@@ -28,9 +72,8 @@
2872
<button id=btn8>8</button>
2973
<button id=btn9>9</button>
3074
<button id=btn10>10</button>
31-
<script>
32-
window.addEventListener('DOMContentLoaded', () => {
33-
for (const button of Array.from(document.querySelectorAll('button')))
34-
button.addEventListener('click', () => console.log('button #' + button.textContent + ' clicked'), false);
35-
}, false);
36-
</script>
75+
<script>for (const button of document.querySelectorAll('button')) {
76+
button.addEventListener('click', () => {
77+
console.log(`button #${button.textContent} clicked`);
78+
});
79+
}</script>

0 commit comments

Comments
 (0)