File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1+ // javascript proof of work to prevent headless browsers while allowing 'good scrapers' like ones that just analyze the HTML
2+
13( function ( ) {
24 const difficulty = 16 ;
35 const timeoutMs = 30000 ;
3335
3436 const updateTimerAndHash = async ( ) => {
3537 const timeLeft = Math . max ( 0 , deadline - performance . now ( ) ) ;
36- const currentHash = await sha256 ( nonce . toString ( ) ) ; // Wait for the hash to resolve
38+ const currentHash = await sha256 ( nonce . toString ( ) ) ;
3739
3840 statusDiv . innerHTML = `
3941 Checking if you are not a robot...
6163 } else {
6264 statusDiv . textContent = "Access denied. If you are a human, please try again later." ;
6365 hiddenElements . forEach ( el => el . innerHTML = "" ) ;
66+ // redirect to example.com
67+ window . location . href = "https://example.com" ;
6468 }
6569 } ) ( ) ;
6670} ) ( ) ;
You can’t perform that action at this time.
0 commit comments