Document.referrer Exists But Is Always Empty
Solution 1:
Since we don't know anything about your native wrapper, it's possible there are a couple of things going on:
document.referrer
is derived from the HTTP headerReferer
(note historical misspelling). It's possible that something in your iOS code is setting or suppressing that HTTP header.If your web app is hosted using URLs with
file
schema (as infile:///foo.html
), browser engines will not set the HTTPReferer
header to prevent leakage of sensitive information. (You wouldn't want to send local filenames to a remote webserver if, for example, you had a local webpage that linked out to a remote site.)
If you find that one of these is happening, you can manually set the Referer
header as described in "Specifying HTTP referer in embedded UIWebView"
Post a Comment for "Document.referrer Exists But Is Always Empty"