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

Post a reply

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: google search results displaying in mobile mode with Noscript, despite being on desktop

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

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

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

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.

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

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

I use a little Greasemonkey script
Link?

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

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!

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

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 ;-).)

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

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.

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

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

Or you could put that CSS in Stylus.

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

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

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

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.

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

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);

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

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.

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

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.

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

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?

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

by therube » Sat Jan 11, 2020 2:41 pm

Code: Select all

Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.5
Changing 5.0 to 4.0 & removing Gecko, helps.

Code: Select all

Mozilla/4.0 (Windows NT 6.1; Win64; x64; rv:56.0) 20100101 SeaMonkey/2.35.1
Though there is still tracking crap.
(And similarly, the actual link that the site you're visiting also has that crap.)

Code: Select all

https://winworldpc.com/product/norton-commander/4x?sa=X&ved=2ahUKEwi68IKJ4fvmAhXIJt8KHWsQC1YQFjABegQIBxAB
But at least there is less delay (where otherwise you go through google.com, first, before reaching your destination).

Any clean way to automatically strip crap, the ?sa=.* part?

Code: Select all

?sa=X&ved=2ahUKEwi68IKJ4fvmAhXIJt8KHWsQC1YQFjABegQIBxAB
There are extensions (that I'd rather not have to use [Pure URL for Pale Moon, legacy]), or a bookmarklet (viewtopic.php?p=100870#p100870, that you'd have to click on a per instance case).
Can NoScript (5.x or 10.x) do it, directly?

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

by sprocketoctopus » Mon Dec 30, 2019 1:10 am

I have unfortunately disabled NoScript, the mobile interface was doing my head in!

I hope there is a fix soon.

~S.O

Top