Zeronet: [Question] ZeroFrame: How to do IF-ZERONET, ELSE?

Created on 21 Aug 2018  路  9Comments  路  Source: HelloZeroNet/ZeroNet

Most helpful comment

if (document.location.href.indexOf("wrapper_nonce") > 0) console.log("ZeroNet"); else console.log("Clearnet");

All 9 comments

Can't force it. Just nudges in the right places at the right times. Slow and steady wins the race, always!

I think you want to be against without understanding.
The question is the zite detect if in ZeroNet, to be adapted to ZeroNet API, and if not, show things about clearnet. Useful for links.

@HelloZeroNet @shortcutme

ZeroNet adds a wrapper_nonce get parameter to every site request. Probably that's the easiest way.

@AnthyG

@HelloZeroNet @shortcutme
Whats the script to identify when wrapper_nonce get?
Then create the variable "ifzeronet" or "zeronet true", and detect this variable, and include a else.

I'm creating FrameworkJS, which will make zites work both on ZeroNet and clearnet, by detecting if on ZeroNet, and when else, use things for clearnet.

if (document.location.href.indexOf("wrapper_nonce") > 0) console.log("ZeroNet"); else console.log("Clearnet");

@HelloZeroNet @shortcutme
How to identify if this is on ZeroNet, ZeroNet proxy or clearnet?

use window.location.href

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yurivict picture yurivict  路  4Comments

DaniellMesquita picture DaniellMesquita  路  3Comments

iShift picture iShift  路  3Comments

DaniellMesquita picture DaniellMesquita  路  3Comments

ghost picture ghost  路  4Comments