Hi i want to detect if website is opened on webview or in a browser. The php code which works is:
<?php if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) == "com.website.reader") { ?>
<p> it works </p>
<?php } ?>
I want to check also it with javascript but when i tried to check it by getting headers like that:
var headerAppend = document.querySelector(".headers-append");
var req = new XMLHttpRequest();
req.open('GET', "com.woblink.reader", false);
req.send(null);
var headers = req.getAllResponseHeaders();
I got only "client via: shouldInterceptRequest content-length: 2582 content-tpe: text/html"
How to achieve it also in JS? User agent doesn't work.