Note that there are some explanatory texts on larger screens.

plurals
  1. POFirefox logs invalid URL?
    primarykey
    data
    text
    <p>I'm writing an extension for firefox. Using dom.location to keep track of visited search results pages, i'm getting this url <a href="http://www.google.com/search?hl=en&amp;source=hp&amp;q=hi&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=642c18fb4411ca2e" rel="nofollow noreferrer">http://www.google.com/search?hl=en&amp;source=hp&amp;q=hi&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=642c18fb4411ca2e</a> . If you click it, the google search results for "hi" should come up. You'll know that from the title bar - because the rest of the page won't load. This happens with any google search. Oddly enough, if you cut part of it off, so say, <a href="http://www.google.com/search?hl=en&amp;source=hp&amp;q=hi" rel="nofollow noreferrer">http://www.google.com/search?hl=en&amp;source=hp&amp;q=hi</a> - it works! But Googling "hi" myself does give me a longish URL - <a href="http://www.google.com/#hl=en&amp;source=hp&amp;q=hi&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=db658cc5049dc510" rel="nofollow noreferrer">http://www.google.com/#hl=en&amp;source=hp&amp;q=hi&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=db658cc5049dc510</a> . I know for a fact that the first time that URL was visited, the page loaded, I did it myself.</p> <p>Can anyone make reason out of this?</p> <p><strong>I just tried my experiment again, this time saving the original URL in the location bar. It turns out, dom.location.href is giving a different value. How is this happening?</strong></p> <p>Original:<br> <a href="http://www.google.com/#hl=en&amp;source=hp&amp;q=hi&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=642c18fb4411ca2e" rel="nofollow noreferrer">http://www.google.com/#hl=en&amp;source=hp&amp;q=hi&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=642c18fb4411ca2e</a></p> <p>dom.location.href<br> <a href="http://www.google.com/search?hl=en&amp;source=hp&amp;q=hi&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=642c18fb4411ca2e" rel="nofollow noreferrer">http://www.google.com/search?hl=en&amp;source=hp&amp;q=hi&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=642c18fb4411ca2e</a></p> <pre><code>window.addEventListener("load", function() { myExtension.init(); }, false); var myExtension = { init: function() { var appcontent = document.getElementById("appcontent"); // browser if(appcontent) appcontent.addEventListener("DOMContentLoaded", myExtension.onPageLoad, true); var messagepane = document.getElementById("messagepane"); // mail if(messagepane) messagepane.addEventListener("load", function () { myExtension.onPageLoad(); }, true); }, onPageLoad: function(aEvent) { var doc = aEvent.originalTarget; // doc is document that triggered "onload" event // do something with the loaded page. // doc.location is a Location object (see below for a link). // You can use it to make your code executed on certain pages only. var url = doc.location.href; if (url.match(/(?:p|q)(?:=)([^%]*)/)) {alert("MATCH" + url);resultsPages.push(url);} else {alert(url); } } </code></pre> <p><strong>This snippet comes directly from <a href="https://developer.mozilla.org/En/Code_snippets/On_page_load" rel="nofollow noreferrer">Mozilla</a> with the matching and alerts my own. I apologize for not posting the code earlier.</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload