Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

lucifer azl397985856

I may be slow to respond.
Block or report user

Report or block azl397985856

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
azl397985856 /
Created Aug 9, 2019

It seems he's doing something with header detection. I used Puppeteer to play around with the site and various configurations I use when scraping. In headless Chrome, the "Accept-Language" header is not sent. In Puppeteer, one can force the header to be sent by doing:

page.setExtraHTTPHeaders({ 'Accept-Language': 'en-US,en;q=0.9' })

However, Puppeteer sends that header as lowercase: accept-language: en-US,en;q=0.9

So it seems the detection is as simply: if there is no 'Accept-Language' header (case-sensitive), then "Headless Chrome"; else, "Not Headless Chrome".

View Bypassing anti-incognito detection in Google
if ('storage' in navigator && 'estimate' in {
	const {usage, quota} = await;
    console.log(`Using ${usage} out of ${quota} bytes.`);

	if(quota < 120000000){
    } else {
        console.log('Not Incognito')
azl397985856 /
Created Aug 5, 2019
生产模式下禁止React Developer Tools、Redux DevTools的使用

React Developer Tools

window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function () {}
import {
azl397985856 / memory.js
Last active Jul 8, 2019
Automatically detect memory leaks with Puppeteer
View memory.js
// from :
const MemoryFileSystem = require('memory-fs'); // eslint-disable-line no-undef
const puppeteer = require('puppeteer'); // eslint-disable-line no-undef
const webpack = require('webpack'); // eslint-disable-line no-undef
// eslint-disable-next-line padding-line-between-statements
const compileBundle = () => {
return new Promise((resolve, reject) => {
const memoryFileSystem = new MemoryFileSystem();
View setCookie.js
function setCookie(cookieName,value,expiresTime,path){
expiresTime = expiresTime || "Thu, 01-Jan-2030 00:00:01 GMT";
path = path || "/";
document.cookie=cookieName+ "=" +encodeURIComponent(value)+ "; expires="+ expiresTime+ "; path="+path;
View svg-frame-animation.less
<svg viewBox="0, 0, 91, 94" class="warm-face">
<image xlink:href="//" width="3458" height="94" />
.warm-face {
position: relative;
azl397985856 /
Last active Sep 5, 2018
updated by Listen1( at 2018/9/5 下午3:51:39

本歌单由Listen1创建, 歌曲数:1,歌单数:1,点击查看更多

azl397985856 /
Created Aug 28, 2018 — forked from chrisco/
Breadth First Search And Depth First Search

Breadth First Search

Algorithm for searching graph-like data structures, one level at a time.

Step by Step

  • Start a queue
  • Check current node - if false, mark as visited, continue
azl397985856 / index.html
Created Jun 30, 2016 — forked from anonymous/index.html
View index.html
<div id="content">123</div>
You can’t perform that action at this time.