I'm using location.href
to get the full URL exists in browser address bar.
To provide more detail, it's important to note that our service has a js file that will be included in our customers sites. So this JS file will generate the full URL of applicant.
I thought this URL is somehow previous URL that redirected to real domain, but how I should prevent this action?
The line of JS code that will generate a link for iframe's src attribute is:
'http://sd.domain.ir/index.php?r=' + Math.floor(Math.random() * (100000000 - 0 + 1)) + 0 + '&ref=' + ((window.btoa) ? btoa(location.href) : 'ie') + '&responsive=' + ((document.querySelector('meta[name="viewport"][content*="width=device-width"]')) ? 'yes' : 'no') + '¶ms='
Examples of applicant UA:
Mozilla\/5.0 (Linux; U; Android 4.3; en-us; HUAWEI G620-L72 Build\/HuaweiG620-L72) AppleWebKit\/534.24 (KHTML, like Gecko) Version\/4.0 Mobile Safari\/534.24 T5\/2.0 bdbrowser\/6.1.0.4
Mozilla\/5.0 (Linux; U; Android 4.4.3; en-ae; HTC_One Build\/KTU84L) AppleWebKit\/534.30 (KHTML, like Gecko) Version\/4.0 Mobile Safari\/534.30
Mozilla\/5.0 (Linux; U; Android 4.3; en-us; GT-I9300 Build\/JSS15J) AppleWebKit\/534.30 (KHTML, like Gecko) Version\/4.0 Mobile Safari\/534.30
...
sometimes strange url generated by location.href
and I don't know what is the reason. For example:
Main URL is something like below: http://saten.ir/tag/%D8%A8%DB%8C%D9%88%DA%AF%D8%B1%D8%A7%D9%81%DB%8C-%D8%A7%D9%85%DB%8C%D8%B1%D8%B9%D8%A8%D8%A7%D8%B3-%D9%81%D8%AE%D8%B1%D8%A2%D9%88%D8%B1/
But the URL returned by location.href
is as below:
http://www.google.com/search?site=&source=hp&ei=mpkeWIvHKYWbsgGtxaSQBg&q=%D8%A7%D9%85%D9%8A%D8%B1%D8%B9%D8%A8%D8%A7%D8%B3+%D9%81%D8%AE%D8%B1%D8%A7%D9%88%D8%B1&oq=%D8%A7%D9%85%D9%8A%D8%B1%D8%B9%D8%A8%D8%A7%D8%B3+%D9%81%D8%AE%D8%B1%D8%A7%D9%88%D8%B1&gs_l=mobile-gws-hp.3...4752.15339.0.16567.0.0.0.0.0.0.0.0..0.0....0...1c.1.64.mobile-gws-hp..0.0.0.UFWL1tf4KDM#scso=uid_WB6ZrwAGHJ0KLAXLjA8j8w_10:2120,uid_WB6aQQAGpZkKLNwFPgmnbA_10:2120
location.href
and send it to the server. Finally server will generate the log with received URL – Artisiframe
issue. – Wileslocation.href
and finally will send generate anIframe
with the URL containing data. It's important to note that the url will encode and then appended to main URL – Artissomething.com
send this irrelevant url as itshref
. but the referrer not exist in our request URL. Does it have any effect on diagnosing the problem – Artis