0

I have a site, let's say www.example.com

An unknown site has a link to my site.

Can I find out automatically where the link is coming from by running a script on www.example.com? window.opener or window.parent?

Please do not think about browser debugging tools, browser extensions or running javascript by user by writing it to the url bar.

Tonechas
  • 13,398
  • 16
  • 46
  • 80
lembas
  • 377
  • 1
  • 7
  • 21
  • 1
    you can check `referer` – Govind Singh Jul 22 '14 at 08:31
  • Are you asking how to scan the Web for links to your site, or how to find out, on a page of yours, what was the referring page if the page was reached by following a link at some other site? These are quite different questions. – Jukka K. Korpela Jul 22 '14 at 10:00

2 Answers2

1

document.referrer gives you the URI of the page that linked to the current page.

more informative link here

Community
  • 1
  • 1
Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231
0

Have you tried using the link: operator in a Google search?

E.g. Googling for link:"stackoverflow.com/questions/2157396/how-do-you-get-the-url-referer-via-a-javascript-include"

Lee Kowalkowski
  • 11,591
  • 3
  • 40
  • 46