Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"This page URL has this ipfs HASH: <b>" + hash + "<b>"
}
else
{
document.getElementById( "url_hash" ).innerHTML =
"This page was not open through IPFS"
}
try {
/* first of all set up the web3 object. THis should work in Mist as well */
if(typeof web3 === 'undefined')
web3 = require('web3');
if( web3.currentProvider == null )
web3.setProvider( new web3.providers.HttpProvider( ) );
/* Get the EtherID API object */
EID = require( "etherid" )
BCH_HASH = EID.getHash( web3, "test", "ipfs" )
document.getElementById( "bch_hash" ).innerHTML =
"The proper hash for the page sould be: <b>" + BCH_HASH + "<b>"
if( hash == BCH_HASH )
{
document.getElementById( "action" ).innerHTML =
"You see the CORRECT version of this website!"
document.getElementById( "action" ).style.color = "green"
}
else</b></b></b></b>
app.factory('web3', function() {
var web3 = require('web3');
web3.setProvider(new web3.providers.AutoProvider());
return web3;
});