-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ported core of puppeteer-extra to deno
- Loading branch information
0 parents
commit 28f131f
Showing
20 changed files
with
1,480 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.unstable": true, | ||
"deno.importMap": "./import_map.json", | ||
"spellright.language": [ | ||
"en" | ||
], | ||
"spellright.documentTypes": [ | ||
"latex", | ||
"plaintext" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# deno-puppeteer-extra | ||
|
||
This is the monorepo for deno port of | ||
[puppeteer-extra](https://github.com/berstend/puppeteer-extra). | ||
|
||
Documentation for each package is located in their individual directories. | ||
General docs can be found inside of the puppeteer_extra directory. | ||
|
||
## FAQ | ||
|
||
### How does this compare to the Node version? | ||
|
||
It doesn't. Just kidding, `deno-puppeteer-extra` is basically a fork of | ||
[puppeteer-extra](https://github.com/berstend/puppeteer-extra). It's not | ||
perfect, or even 1:1 yet, but most of the critical modules have been added. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function debug(...args: any[]) { | ||
if (Deno.args.includes("debug")) { | ||
console.log(...args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function isObject(item: any) { | ||
return (item && typeof item === "object" && !Array.isArray(item)); | ||
} | ||
|
||
export default function merge(target: any, source: any) { | ||
const output = Object.assign({}, target); | ||
if (isObject(target) && isObject(source)) { | ||
Object.keys(source).forEach((key) => { | ||
if (isObject(source[key])) { | ||
if (!(key in target)) { | ||
Object.assign(output, { [key]: source[key] }); | ||
} else { | ||
output[key] = merge(target[key], source[key]); | ||
} | ||
} else { | ||
Object.assign(output, { [key]: source[key] }); | ||
} | ||
}); | ||
} | ||
return output; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"importMap": "import_map.json", | ||
"tasks": { | ||
"test": "deno test -A" | ||
}, | ||
"lint": { | ||
"rules": { | ||
"exclude": ["no-explicit-any"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"imports": { | ||
"puppeteer": "https://deno.land/x/puppeteer@16.2.0/mod.ts", | ||
"puppeteer/": "https://deno.land/x/puppeteer@16.2.0/", | ||
"assert": "https://deno.land/std@0.153.0/testing/asserts.ts", | ||
"@": "./mod.ts", | ||
"@/": "./" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { default as puppeteer } from "./packages/puppeteer_extra/src/mod.ts"; | ||
export { PuppeteerExtraPlugin } from "./packages/puppeteer_extra_plugin/src/mod.ts"; | ||
export { default as puppeteer_extra_plugin_anonymize_ua } from "./packages/puppeteer_extra_plugin_anonymize_ua/mod.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# puppeteer-extra | ||
|
||
> A light-weight wrapper around deno-puppeteer to enable plugins through a clean | ||
> interface. | ||
## Quickstart | ||
|
||
```typescript | ||
import { puppeteer } from "https://deno.land/x/puppeteer_extra/mod.ts"; | ||
``` |
Oops, something went wrong.