Skip to content

Commit 7931b37

Browse files
committed
what about firefox
1 parent 939a370 commit 7931b37

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

.github/workflows/ci.yml

+16
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ jobs:
2626
- name: Run
2727
run: deno task run
2828

29+
ubuntu-firefox:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout Repository
34+
uses: actions/checkout@v4
35+
36+
- name: Install Deno
37+
uses: denoland/setup-deno@v1
38+
39+
- name: Install chromium
40+
run: deno run -A npm:[email protected] install --with-deps firefox
41+
42+
- name: Run
43+
run: deno task firefox
44+
2945
mac:
3046
runs-on: macos-latest
3147

deno.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"tasks": {
3-
"run": "deno run -A main.ts"
3+
"run": "deno run -A main.ts",
4+
"firefox": "deno run -A firefox.ts"
45
},
56
"imports": {
67
"@std/assert": "jsr:@std/assert@1"

firefox.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { firefox } from "npm:[email protected]";
2+
3+
async function main() {
4+
await using browser = await firefox.launch({
5+
headless: true,
6+
});
7+
await using page = await browser.newPage();
8+
await page.goto("https://example.com");
9+
const title = await page.title();
10+
console.log(`title: ${title}`);
11+
}
12+
13+
if (import.meta.main) {
14+
await main();
15+
}

0 commit comments

Comments
 (0)