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 fs = require('fs'); | |
const puppeteer = require('puppeteer'); | |
const GIFEncoder = require('gifencoder'); | |
const PNG = require('png-js'); | |
function decode(png) { | |
return new Promise(r => {png.decode(pixels => r(pixels))}); | |
} |
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 puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch({ headless: false }); | |
const page = await browser.newPage(); | |
await page.goto('https://test-navlang-demo-vvkpjvrhym.now.sh'); | |
await page.setViewport({ width: 1380, height: 900 }); | |
await page.waitFor(1000); | |
const page2 = await browser.newPage(); |
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 puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch({ | |
headless: false, | |
}) | |
const page = await browser.newPage() | |
await page.setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36') | |
await page.setViewport({ width: 1200, height: 800, deviceScaleFactor: 1 }); |
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
// ==UserScript== | |
// @name Open Douban Link Directly | |
// @namespace https://www.douban.com/people/MoNoMilky/ | |
// @version 0.2 | |
// @description Do not remind me of leaving Douban please, I know that... | |
// @match https://*.douban.com/* | |
// @author Bambooom | |
// @grant none | |
// ==/UserScript== |
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
var cmDom = document.getElementsByClassName('CodeMirror'); | |
// if multiple CodeMirror instances, for each one, the instance referece can be got from `CodeMirror` prop on the dom node | |
var editor1 = document.getElementsByClassName('CodeMirror')[0].CodeMirror; | |
// CodeMirror$1 object | |
// ... | |
var editor2 = document.getElementsByClassName('CodeMirror')[1].CodeMirror; | |
// CodeMirror$2 object | |
// ... |
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
// ==UserScript== | |
// @name Shuffle iSay | |
// @namespace https://www.douban.com/people/MoNoMilky/ | |
// @version 0.2 | |
// @description Your brain is strange and strong, interesting. | |
// @author Bambooom | |
// @match https://*.douban.com/* | |
// @grant none | |
// ==/UserScript== |
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
// modified from https://gist.github.com/hsablonniere/2581101 | |
function getParent(el) { | |
var parent = el.parentNode; | |
if (parent === document) { | |
return document; | |
} else if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) { | |
return parent; | |
} else { |
OlderNewer