google search results displaying in mobile mode with Noscript, despite being on desktop

Ask for help about NoScript, no registration needed to post
asaone7

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by asaone7 » Sun Jan 26, 2020 1:25 am

Hi Therube,

Sorry I'm completely inexperienced with this kind of stuff. Is this a temporary/partial workaround? If so, where do I add it in FF?
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

User avatar
therube
Ambassador
Posts: 7528
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by therube » Sun Jan 26, 2020 1:07 pm

There is no magic bullet (that I've found, yet).

Even with the changes I have made, there is still tracking crap & ugly URLs.
But at least links open faster because they are not directed through "google", first.

There are ways to clean up my links (with extensions, to remove the "ugly" parts) which I would prefer not to use.
So I have quick, but ugly URLs.

Otherwise, to get to what I have done, you need to spoof your (browser) User Agent.

In a real browser, you can do that directly (in about:config).
You add a new entry:
  • Type: string
    Name: general.useragent.override.google.com
    Value: Mozilla/4.0 (Windows NT 6.1; Win64; x64; rv:56.0) 20100101 SeaMonkey/2.35.1
(or something to your liking that works, with the 'Mozilla/4.0' being important, & the removal of the 'Gecko' part)

In current FF (Quantum, & if in Quantum, then I suppose must be in Chrome too) you would need to use an extension to accomplish the same.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.2 Lightning/5.8.1

asaone7

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by asaone7 » Mon Jan 27, 2020 4:43 am

Unfortunately for me it didn't work :(
Actually, the light shined for about 1 second before it went out. When searching in google the first time after adding that string, the page was loading in desktop mode for a second, then it immediately after switched to mobile mode.
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

skriptimaahinen
Senior Member
Posts: 178
Joined: Wed Jan 10, 2018 7:37 am

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by skriptimaahinen » Mon Jan 27, 2020 1:37 pm

First of all, since FF71, site specific settings (general.useragent.override.somesite.com) do not work anymore. The pref has been removed.

Also note that general.useragent.override (global useragent change) has no effect if privacy.resistFingerprinting is enabled.

The official way to change useragent from now on is to use webextension. Sorry, do not have any recommendations to give but for quick testing I like to use FireFox's Responsive Design Mode. It has built-in useragent switcher.


I don't think therube is talking about getting back the desktop search but something else.


The desktop search you briefly saw is the one meant for javascript users. The usability is quite poor without javascript enabled. You can check yourself but that requires some extra steps:

First you need to disable automatic redirects. In about:config set accessibility.blockautorefresh to true.

Now when making a Google search you should be greeted by the "redirect blocked" message from FireFox. Do not press the Allow-button.

The page appears to be blank, although it's not. The content is hidden by some CSS-fu. There are several ways to make it appear again.

Right click on the blank page and select "Inspect Element". Toolbox should open and show the html tree. Select first <span> element you see. Now you should have the "Rules" tab open on the right side. Find the rule for "table, div, span, p" and untick the line "display: none". The search results should be now visible on the page. You can close the toolbox but do note that you need to redo this for every page. These changes are not saved.

OR paste the following code to the Console (Ctrl+Shift+K):

Code: Select all

css = `table, div, span, p { display: revert; }`;
style = document.createElement('style');
style.appendChild(document.createTextNode(css));
document.body.appendChild(style);
Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0

asaone7

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by asaone7 » Tue Jan 28, 2020 11:11 pm

Eh, I'm on an older version of Firefox anyway. I think that puts me even more at a disadvantage.
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

sprocketoctopus
Posts: 11
Joined: Sat May 25, 2019 2:01 am

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by sprocketoctopus » Tue Jan 28, 2020 11:13 pm

skriptimaahinen wrote:
Mon Jan 27, 2020 1:37 pm
First of all, since FF71, site specific settings (general.useragent.override.somesite.com) do not work anymore. The pref has been removed.

Also note that general.useragent.override (global useragent change) has no effect if privacy.resistFingerprinting is enabled.

The official way to change useragent from now on is to use webextension. Sorry, do not have any recommendations to give but for quick testing I like to use FireFox's Responsive Design Mode. It has built-in useragent switcher.


I don't think therube is talking about getting back the desktop search but something else.


The desktop search you briefly saw is the one meant for javascript users. The usability is quite poor without javascript enabled. You can check yourself but that requires some extra steps:

First you need to disable automatic redirects. In about:config set accessibility.blockautorefresh to true.

Now when making a Google search you should be greeted by the "redirect blocked" message from FireFox. Do not press the Allow-button.

The page appears to be blank, although it's not. The content is hidden by some CSS-fu. There are several ways to make it appear again.

Right click on the blank page and select "Inspect Element". Toolbox should open and show the html tree. Select first <span> element you see. Now you should have the "Rules" tab open on the right side. Find the rule for "table, div, span, p" and untick the line "display: none". The search results should be now visible on the page. You can close the toolbox but do note that you need to redo this for every page. These changes are not saved.

OR paste the following code to the Console (Ctrl+Shift+K):

Code: Select all

css = `table, div, span, p { display: revert; }`;
style = document.createElement('style');
style.appendChild(document.createTextNode(css));
document.body.appendChild(style);
So if I understand correctly, even if I did all that (or paste code into Console) it will not be saved, ie. needs to be done for every page?

Thanks for taking the time for a possible workaround, skriptimaahinen

Cheers
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0

barbaz
Senior Member
Posts: 9343
Joined: Sat Aug 03, 2013 5:45 pm

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by barbaz » Tue Jan 28, 2020 11:31 pm

Or you could put that CSS in Stylus.
*Always* check the changelogs BEFORE updating that important software!
-

skriptimaahinen
Senior Member
Posts: 178
Joined: Wed Jan 10, 2018 7:37 am

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by skriptimaahinen » Wed Jan 29, 2020 5:26 am

@asaone7: At least you are more free to toy around with the useragents. Not that it seems to be of any help in this case...

@sprocketoctopus:

Any style changes done in the Inspect Element or Console are reset every time you refresh or go to another page.

But like barbaz said, you could use Stylus to automatically apply the style if you want it to be permanent. The above code works as Greasemonkey script too.

I would not call this a workaround though, as the page is not really useful without javascript. Not without extensive fixing.
Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0

User avatar
therube
Ambassador
Posts: 7528
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by therube » Wed Jan 29, 2020 1:34 pm

I don't, we, still don't know what asaone7 is running.

In any case, my post (mainly) deals with "legacy".

I did note that current FF (Quantum) would need an extension to spoof the UA (on a per site basis).

Pure URL for Pale Moon will work in clean up the "crap" part that my spoofed UA still leaves behind.
(You'll need to modify Pure URL, adding a "SeaMonkey" part [in my case] to install.rdf in order for it to install [in SeaMonkey]. It will work, in PM, obviously. Other browsers, that thing called [legacy] FF, depending on browser version & settings, may need to have a "signed" extension in which case you may be able to work around it or it will not work at all, depending.)
I think there is a webextension version of Pure URL?
In Pure URL, i added "sa=@google.com" to its settings & that seems to be what is needed to zap the crap (part of the URL).

https://addons.palemoon.org/addon/pureurl4pm/
Well that was yesterday, literally.

Google has been making changes (what's new).
https://finance.yahoo.com/news/googles-latest-user-hostile-design-103839040.html
Yesterday, literally, all worked.
Today, no longer.

Matter of fact, currently, with JavaScript disabled, with Pure URL installed (though I don't thing affecting anything at the moment), with my spoofed UA, I get crap URLs:

https://www.google.com/url?q=http://www.vcfed.org/forum/archive/index.php/t-21420.html&usg=AOvVaw0hbtuGZOVQShjsnP_cmwSa

AND, Google now gives you a redirect notice:
Redirect Notice

The previous page is sending you to http://www.vcfed.org/forum/archive/index.php/t-21420.html.

If you do not want to visit that page, you can return to the previous page.
Image
(though I don't thing affecting anything at the moment)
Actually, something with Pure URL is what ended up causing this.

In any case, the above work-arounds no longer work.
(And no more time to screw with this, now.)


(Have you ever gotten the ideal the Google may be tracking, you ;-).)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.2 Lightning/5.8.1

skriptimaahinen
Senior Member
Posts: 178
Joined: Wed Jan 10, 2018 7:37 am

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by skriptimaahinen » Wed Jan 29, 2020 2:36 pm

therube wrote:
Wed Jan 29, 2020 1:34 pm
I did note that current FF (Quantum) would need an extension to spoof the UA (on a per site basis).
I did notice but felt the need to highlight it. Took me by surprise when I found out about it only few days ago.

I use a little Greasemonkey script to remove the "https://www.google.com/url?q=..." redirects from Google search results. One of the oldest userscripts in my use and have not noticed it failing ever.
therube wrote:
Wed Jan 29, 2020 1:34 pm
(Have you ever gotten the ideal the Google may be tracking, you ;-).)
Surely you must jest!
Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0

User avatar
therube
Ambassador
Posts: 7528
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by therube » Fri Feb 07, 2020 12:05 am

I use a little Greasemonkey script
Link?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.2 Lightning/5.8.1

skriptimaahinen
Senior Member
Posts: 178
Joined: Wed Jan 10, 2018 7:37 am

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by skriptimaahinen » Fri Feb 07, 2020 6:14 pm

There is no link - wrote it myself. Here:

Code: Select all

// ==UserScript==
// @name     Google Redirect Removal
// @version  1
// @license  Public Domain
// @include  *://*.google.com/*
// @grant    none
// ==/UserScript==

// Remove google.com redirect from the links.
for(let i = 0; i < document.links.length; i++) {
    let link = document.links[i];
    if (link.pathname === "/url") {
        let url = new URL(link.href);
        if (url.searchParams.has("q")) {
            link.href = url.searchParams.get("q");
        }
    }
}
Add more @include lines for any country-specific searches you might use.
Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0

asaone7

Re: google search results displaying in mobile mode with Noscript, despite being on desktop

Post by asaone7 » Thu Feb 20, 2020 4:26 pm

@therube,

Sorry late reply. I'm using Firefox 56.0.3. It's an older laptop
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

Post Reply