This file contains hidden or 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
/** | |
* Type utils | |
*/ | |
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] }; | |
function deepAssign( | |
target: Record<string, any>, | |
...sources: Record<string, any>[] | |
) { |
This file contains hidden or 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
fetch("https://gist.github.com/serebano/83304400d6141751c38202bb66d14f83/raw") | |
.then(async (r) => (await import(`data:application/javascript;base64,${btoa(await r.text())}`))) |
This file contains hidden or 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
export default function RequestModule() { | |
/** | |
* Type utils | |
*/ | |
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] }; | |
function deepAssign( | |
target: Record<string, any>, | |
...sources: Record<string, any>[] | |
) { |
This file contains hidden or 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
export default function RequestModule() { | |
function deepAssign(target, ...sources) { | |
for (const source of sources) { | |
for (const k in source) { | |
const vs = source[k], | |
vt = target[k]; | |
if (Object(vs) == vs && Object(vt) === vt) { | |
target[k] = deepAssign(vt, vs); | |
continue; | |
} |
This file contains hidden or 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
export const modURL = () => URL.createObjectURL(new Blob([new Uint8Array([47,42,42,10,32,42,32,84,121,112,101,32,117,116,105,108,115,10,32,42,47,10,116,121,112,101,32,83,105,109,112,108,105,102,121,60,84,62,32,61,32,123,32,91,75,101,121,84,121,112,101,32,105,110,32,107,101,121,111,102,32,84,93,58,32,84,91,75,101,121,84,121,112,101,93,32,125,59,10,10,102,117,110,99,116,105,111,110,32,100,101,101,112,65,115,115,105,103,110,40,10,32,32,32,32,116,97,114,103,101,116,58,32,82,101,99,111,114,100,60,115,116,114,105,110,103,44,32,97,110,121,62,44,10,32,32,32,32,46,46,46,115,111,117,114,99,101,115,58,32,82,101,99,111,114,100,60,115,116,114,105,110,103,44,32,97,110,121,62,91,93,10,41,32,123,10,32,32,32,32,102,111,114,32,40,99,111,110,115,116,32,115,111,117,114,99,101,32,111,102,32,115,111,117,114,99,101,115,41,32,123,10,32,32,32,32,32,32,32,32,102,111,114,32,40,99,111,110,115,116,32,107,32,105,110,32,115,111,117,114,99,101,41,32,123,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,118,115,32,61,32,115,111,11 |
This file contains hidden or 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
const myModule = await import(URL.createObjectURL(new Blob( | |
[` | |
// module code inside this template literal | |
`], | |
{type: "text/javascript"}, | |
))); |
This file contains hidden or 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
module.exports = async ({ page, context }) => { | |
//const { url } = context; | |
const url = 'https://example.com' | |
await page.goto(url); | |
const data = await page.content(); | |
return { | |
data, | |
// Make sure to match the appropriate content here |
This file contains hidden or 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
module.exports = async({ page }) => { | |
await page.goto('https://google.com/'); | |
await page.click('button#L2AGLb', { | |
clickCount: 1, | |
delay: 200 | |
}); | |
await page.type('input[type="text"]', 'whats new around'); | |
This file contains hidden or 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
export default (ctx) => ({ ctx, res: Promise.resolve(123) }) |
This file contains hidden or 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
<a | |
style="display:block;position:fixed;z-index:9999999;width:100%;height:100%;top:0;left:0" | |
href="/" | |
target="_blank" | |
onclick="setTimeout(function(){ document.location.href='https://example.com' }, 100)"> | |
</a> |
NewerOlder