私はここで達成したい電話番号がアリペイに登録するかどうかを判断するためにアリペイの移転によるものです。しかし、クエリ受信者のネットワーク要求は、複雑な分析が出てこないが、使用puppteerが解決されていない「操作頻度の高い」問題はそれを文書化し、ここで、(私は考慮されていない他の判断の多くをがあるはずです)。
分析
転送が「頻繁に操作」ユーザーが報告されるかどうか問い合わせがあります
気持ちがヘッドレスブラウザを確認することができますが、何のJS検索はありませんwebdrive
。そして、メモリのスナップショットによる外観は本当にそこましたwebdrive
。。(ではないが百パーセント必ずヘッドレスブラウザが、その後いくつかのビットの役割をカンニング製)
解決しようと
よると、ない検出することが可能とブロッククロームヘッドレスチート:(追加ページが隠されている、この感覚も検出されてもよいです)
// We'll use Puppeteer is our browser automation framework.
const puppeteer = require('puppeteer');
// This is where we'll put the code to get around the tests.
const preparePageForTests = async (page) => {
// Pass the User-Agent Test.
const userAgent = 'Mozilla/5.0 (X11; Linux x86_64)' +
'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Safari/537.36';
await page.setUserAgent(userAgent);
// Pass the Webdriver Test.
await page.evaluateOnNewDocument(() => {
Object.defineProperty(navigator, 'webdriver', {
get: () => false,
});
});
// Pass the Chrome Test.
await page.evaluateOnNewDocument(() => {
// We can mock this in as much depth as we need for the test.
window.navigator.chrome = {
runtime: {},
// etc.
};
});
// Pass the Permissions Test.
await page.evaluateOnNewDocument(() => {
const originalQuery = window.navigator.permissions.query;
return window.navigator.permissions.query = (parameters) => (
parameters.name === 'notifications' ?
Promise.resolve({ state: Notification.permission }) :
originalQuery(parameters)
);
});
// Pass the Plugins Length Test.
await page.evaluateOnNewDocument(() => {
// Overwrite the `plugins` property to use a custom getter.
Object.defineProperty(navigator, 'plugins', {
// This just needs to have `length > 0` for the current test,
// but we could mock the plugins too if necessary.
get: () => [1, 2, 3, 4, 5],
});
});
// Pass the Languages Test.
await page.evaluateOnNewDocument(() => {
// Overwrite the `plugins` property to use a custom getter.
Object.defineProperty(navigator, 'languages', {
get: () => ['zh-CN', 'zh', 'en'],
});
});
// 可能会检测页面是否隐藏,处理一下
await page.evaluateOnNewDocument(() => {
// Overwrite the `hidden` property
Object.defineProperty(document, "hidden", {
get: () => false
});
Object.defineProperty(document, "webkitHidden", {
get: () => false
});
});
}
(async () => {
// Launch the browser in headless mode and set up a page.
const browser = await puppeteer.launch({
args: ['--no-sandbox'],
headless: true,
});
const page = await browser.newPage();
// Prepare for the tests (not yet implemented).
await preparePageForTests(page);
// Navigate to the page that will perform the tests.
const testUrl = 'https://intoli.com/blog/' +
'not-possible-to-block-chrome-headless/chrome-headless-test.html';
await page.goto(testUrl);
// Save a screenshot of the results.
await page.screenshot({path: 'headless-test-result.png'});
// Clean up.
await browser.close()
})();
他のブログには、これを削除するには、次のように述べているwebdriver
が、私はそう悪いテスト:
const browser = await puppeteer.launch({ignoreDefaultArgs: ["--enable-automation"]});
PS:ここでの問題は完全に、頻繁に二回のクエリを解決していません。最後に、使用appiumオペレーティングアリペイAPPは、(ユーザーが電話番号に目を通すしないように設定することができるので、この方法でも問題がある)を実現しました。。
広げます
navigator.webdriver
プロパティ
クロームの興味缶外観は、この属性の理由を追加します。https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/6GysDZCWwB8/rXbGoRohBgAJ
缶ChromeStatusは、プロパティがバージョン63に追加されていることが、(クロムバージョン64.0.3240.0(r508693)に相当)に、このプロパティのニーズはv0.11.0に、効果的な人形遣いのv0.12.0で始まった(63.0.3205.0(r499413 ))力ではまだインチ
メモリのスナップショットでそれを持っていたあなたは、任意の文字列の混乱を見つけることができますか?
ない、メモリ(文字列にもとがっ参照)にリリースされていません探しているしなければならないが見つけることができます。例えば:
検出不可能:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<script>
(function test() {
var fun_a = "\167\145\142\144\162\151\166\145\162";
})();
("\167\145\142\144\162\151\166\145\162");
var a = navigator["\167\145\142\144\162\151\166\145\162"];
console.log(a);
var window.b = "\167\145\142\144\162\151\166\145\162";
delete window.b;
</script>
</body>
</html>
それを検出することができます。
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<script>
var a = "\167\145\142\144\162\151\166\145\162";
function test() {
var fun_a = "\167\145\142\144\162\151\166\145\162";
return navigator[fun_a];
}
var b = test();
//> [...'webdriver'].map((d, i)=>String.fromCharCode(d.charCodeAt(0) + 1)).join('')
//'xfcesjwfs'
var other_1 = [..."xfcesjwfs"]
.map((d, i) => String.fromCharCode(d.charCodeAt(0) - 1))
.join("");
</script>
</body>
</html>