Search code examples
javascriptfunctionwindow

Would Window.Open() Command Be Considered A Referral?


I'm using a local script in Firefox (file:///filepath/...) to open urls. One part of the script uses the window.open() command. A sample of the code is below:

        if(x[i].indexOf('.') > 0) {
            if(x[i].indexOf('://') < 0) {
                window.open('http://' + x[i++]);
            } else {
                window.open(x[i++]);
            }

For the JavaScript experts, when the script is opening a url. Is there anyway the local file (file:///filepath/...) would be considered a referral?

I don't want it to show up as a referring page in analytics. I just want to confirm that the window.open command only opens windows as if I typed them in. Is that correct?


Solution

  • I was able to confirm that the window.open command does not act as a referral. By running a few test runs on a site, I was able to verify through analytics that they are direct visits as if you typed them in.

    Hope this helps anyone wondering if window.open will reveal their local path.