1

I tried to make an add-ons to send the URL of a website that I'm open,

function xxxx() 
{
a = "mailto:xxx@xxxx.com?subject= xxxxxxxxxxxxxxxxxx" + document.title;
a += "&body=" + escape("url" + window.location.href);
window.location.href = a;
}

but that appears is

"chrome :/ / browser / content / browser.xul" << overlay in chrome.manifest

is there any solution or any other way to solve that problem?

No Fa
  • 11
  • 1

4 Answers4

0
document.URL

Or

location.href

for more browser support.

window.location object on MDN

Web_Designer
  • 72,308
  • 93
  • 206
  • 262
  • the problem is why the url links that appear is overlay url "chrome :/ / browser / content / browser.xul" at file "chorme.manifest"? not the url that I'm open – No Fa Feb 26 '13 at 07:50
  • This does not fix the problem. – Deanie May 20 '21 at 18:08
-1

For most browsers:

document.URL

For some versions if FF:

window.location.href
rakhim
  • 164
  • 8
-1

use this in jquery

$(location).attr('href');

OR in Javascript

alert(window.location);

hope this helps

Roger
  • 1,693
  • 1
  • 18
  • 34
  • the problem is why the url links that appear is overlay url "chrome :/ / browser / content / browser.xul" at file "chorme.manifest"? not the url that I'm open. – No Fa Feb 26 '13 at 07:47
-1

Here are some ways of retrieving URL path using Javascript and JQuery

//jquery
$(location).attr('href');

//pure javascript
var pathname = window.location.pathname;

For more information, refer this blog post : http://www.jquery4u.com/snippets/jquery-current-page-url/

Thank you,

Rahul Patil

Rahul Patil
  • 5,656
  • 6
  • 37
  • 65