Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Add support for news.google.com #12

Open
FatOrangutan opened this issue Nov 20, 2016 · 6 comments
Open

[Request] Add support for news.google.com #12

FatOrangutan opened this issue Nov 20, 2016 · 6 comments

Comments

@FatOrangutan
Copy link

All links on Google news redirect through Google before taking you to the actual link.

Would be great if support for this can be added.

@vad1m
Copy link
Contributor

vad1m commented Apr 18, 2017

Cannot reproduce, please provide examples.

@FatOrangutan
Copy link
Author

FatOrangutan commented Apr 18, 2017

With Direct Links Out v2.16, Greasemonkey 3.10beta1, Firefox 55.0a1 (2017-04-12).

STR:

  1. Add https://news.google.com/* to the script's included URL so that it runs there.
  2. Go to https://news.google.com/.
  3. Right click a story's link > Open in new tab. Immediately switch to the newly opened tab (ctrl+tab might be helpful).

AR: Watch URL redirect from gibberish (e.g.: https://news.google.com/news/url?sr=1&ct2=in%2F0_0_s_2_1_a&sa=t&usg=AFQjCNH3LYYcdpY_4tX6MQbF_Dxm-elVMQ&cid=52779463036408&url=http%3A%2F%2Fwww.cricbuzz.com%2Fcricket-news%2F94074%2Fipl-2017-rcb-cricket-chris-gayles-form-key-to-rcbs-revival&ei=nKT2WMDPJJSQ4QKlmayYAw&rt=HOMEPAGE&vm=STANDARD&bvm=section&did=-2918636415283716038&sid=toptop&ssid=h&st=1&at=dt0_) to actual URL (for above, http://www.cricbuzz.com/cricket-news/94074/ipl-2017-rcb-cricket-chris-gayles-form-key-to-rcbs-revival).

BTW, I noticed that you forked the repo and fixed a couple of issues. Could you fix them in the same branch or maybe upload to Greasyfork, so that I can install your userscript instead of this one, as it seems to no longer being developed. Thanks.

@nokeya
Copy link
Owner

nokeya commented Apr 19, 2017

If you open a link with middle mouse click it will go without redirection.
But this is really is an issue, Google+ is another site with this behaviour. I don't know how to fix this at this moment

@FatOrangutan
Copy link
Author

Oh hey, you are back :)
Sorry for prematurely assuming that this script was abandoned.

@vad1m
Copy link
Contributor

vad1m commented Apr 24, 2017

Unfortunately was not able to reproduce anyway :) Maybe that's because I have some other blocking rules in umatrix or ublock.

@planigan
Copy link

Any movement on this?

This is the markup for a link to https://arstechnica.com/gadgets/2019/02/usb-3-2-is-going-to-make-the-current-usb-branding-even-worse/ after the redirect in news.google.com:

<article class="MQsxIb xTewfe R7GTQ keNKEd j7vNaf Cc0Z5d YKEnGe EyNMab t6ttFe Fm1jeb EjqUne" jscontroller="mhFxVb" jsaction="rcuQ6b:npT2md;click:KjsqPd;EXlHgb:HQ4Dqd" jsmodel="QWGJif zT6vwb" data-n-ham="true" jsdata="oM6qxc;CBMiZWh0dHBzOi8vYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2Uv0gGzAWh0dHBzOi8vYXJzdGVjaG5pY2EtY29tLmNkbi5hbXBwcm9qZWN0Lm9yZy92L3MvYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2UvP2FtcD0xJmFtcF9qc192PTAuMSN3ZWJ2aWV3PTEmY2FwPXN3aXBl;$502" data-kind="13" data-n-et="107" data-n-cvid="c95">
  <a class="VDXfz" href="./articles/CBMiZWh0dHBzOi8vYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2Uv0gGzAWh0dHBzOi8vYXJzdGVjaG5pY2EtY29tLmNkbi5hbXBwcm9qZWN0Lm9yZy92L3MvYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2UvP2FtcD0xJmFtcF9qc192PTAuMSN3ZWJ2aWV3PTEmY2FwPXN3aXBl?hl=en-US&amp;gl=US&amp;ceid=US%3Aen" tabindex="-1" target="_blank" aria-hidden="true" rel="noreferrer" referrerpolicy="no-referrer">
  </a>
  <div class="mEaVNd">
    <div class="ZulkBc qNiaOd">
      <h3>
        <a href="./articles/CBMiZWh0dHBzOi8vYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2Uv0gGzAWh0dHBzOi8vYXJzdGVjaG5pY2EtY29tLmNkbi5hbXBwcm9qZWN0Lm9yZy92L3MvYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2UvP2FtcD0xJmFtcF9qc192PTAuMSN3ZWJ2aWV3PTEmY2FwPXN3aXBl" class="ipQwMb Q7tWef">
          <span>
            USB 3.2 is going to make the current USB branding even worse
          </span>
        </a>
      </h3>
      <p class="HO8did Baotjf" aria-hidden="true">
      USB 3.2, which doubles the maximum speed of a USB connection to 20Gb/s, is likely to materialize in systems later this year. In preparation for this, the ...
      </p>
    </div>
  </div>
  <div class="QmrVtf kybdz">
    <div class="SVJrMe">
      <div class="PNwZO zhsNkd">
        <span class="KbnJ8">
          Ars Technica
        </span>
      </div>
      <time class="WW6dff" datetime="2019-02-26T21:21:00Z">
        5 hours ago
      </time>
    </div>
    <menu class="fmkQje B62sO">
      <div data-state-type="bookmark" data-n-et="1000" jsaction="rcuQ6b:npT2md;JIbuQc:h5M12e" jscontroller="j3kq0e" jsmodel="Vf5Xdc" jsdata="oM6qxc;CBMiZWh0dHBzOi8vYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2Uv0gGzAWh0dHBzOi8vYXJzdGVjaG5pY2EtY29tLmNkbi5hbXBwcm9qZWN0Lm9yZy92L3MvYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2UvP2FtcD0xJmFtcF9qc192PTAuMSN3ZWJ2aWV3PTEmY2FwPXN3aXBl;$503" class="OGsJDe L8PZAb R71ogd" data-n-ca-at="2">
        <div role="button" class="U26fgb YOnsCc waNn5b ZqhUjb ztUP4e uUmIDd cd29Sd V3dfMc w0hkKb" jscontroller="nGXkff" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;;OuuAFc:UauMyf;gSufsc:BS8cLb;RyWlBb:tC9Erd;UTnG9:aDaYxb;nUyoxf:El6wk;" jsshadow="" jsname="itaskb" aria-disabled="false" tabindex="0" data-n-et="1000" aria-label="Save for later" data-tooltip="Save for later">
          <div class="XI1L0d" jsname="ksKsZd">
          </div>
          <span class="DPvwYc ChwdAb Xd067b fAk9Qc" aria-hidden="true" jsname="BC5job">
            bookmark_border
          </span>
        </div>
      </div>
      <span class="L8PZAb uG2FLd" jscontroller="ewrQ6c" jsmodel="cQe25d" jsaction="JIbuQc:RNDhHe;" jsdata="oM6qxc;CBMiZWh0dHBzOi8vYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2Uv0gGzAWh0dHBzOi8vYXJzdGVjaG5pY2EtY29tLmNkbi5hbXBwcm9qZWN0Lm9yZy92L3MvYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2UvP2FtcD0xJmFtcF9qc192PTAuMSN3ZWJ2aWV3PTEmY2FwPXN3aXBl;$504">
        <div role="button" class="U26fgb YOnsCc waNn5b ZqhUjb ztUP4e uUmIDd cd29Sd V3dfMc w0hkKb " jscontroller="nGXkff" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;;OuuAFc:UauMyf;gSufsc:BS8cLb;RyWlBb:tC9Erd;UTnG9:aDaYxb;nUyoxf:El6wk;" jsshadow="" jsname="itaskb" aria-label="Share" aria-disabled="false" tabindex="0" data-tooltip="Share" data-n-et="1000" data-tooltip-vertical-offset="-12" data-tooltip-horizontal-offset="0">
          <div class="XI1L0d" jsname="ksKsZd">
          </div>
          <span class="DPvwYc ChwdAb Xd067b fAk9Qc" aria-hidden="true" jsname="BC5job">
            share
          </span>
        </div>
      </span>
      <span class=" L8PZAb GB1Zid" jscontroller="Md9Mid" jsmodel="jZ86ec Vf5Xdc" jsdata="oM6qxc;CBMiZWh0dHBzOi8vYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2Uv0gGzAWh0dHBzOi8vYXJzdGVjaG5pY2EtY29tLmNkbi5hbXBwcm9qZWN0Lm9yZy92L3MvYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2UvP2FtcD0xJmFtcF9qc192PTAuMSN3ZWJ2aWV3PTEmY2FwPXN3aXBl;$505 tbf4if;ui|124+6966dbc1-cdf5-4cda-990b-7ec02710fcd2;$506" jsaction="rcuQ6b:npT2md;aWRkAb:u0WEMd;h4C2te:Oy8cwd;" data-n-prms="[true]" id="ow953" __is_owner="true">
        <div role="button" class="U26fgb YOnsCc waNn5b ZqhUjb ztUP4e uUmIDd gL67me cd29Sd V3dfMc w0hkKb " jscontroller="Ui93ue" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;;keydown:I481le;OuuAFc:UauMyf;gSufsc:BS8cLb;RyWlBb:tC9Erd;UTnG9:aDaYxb;nUyoxf:El6wk;" jsshadow="" jsname="itaskb" aria-label="More" aria-disabled="false" tabindex="0" data-tooltip="More" aria-haspopup="true" aria-expanded="false" data-dynamic="true" data-tooltip-vertical-offset="-12" data-tooltip-horizontal-offset="0">
          <div class="XI1L0d" jsname="ksKsZd">
          </div>
          <span class="DPvwYc ChwdAb Xd067b fAk9Qc" aria-hidden="true" jsname="BC5job">
            more_vert
          </span>
        </div>
      </span>
    </menu>
  </div>
</article>

They seem to be encoding the URL here as:
CBMiZWh0dHBzOi8vYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2Uv0gGzAWh0dHBzOi8vYXJzdGVjaG5pY2EtY29tLmNkbi5hbXBwcm9qZWN0Lm9yZy92L3MvYXJzdGVjaG5pY2EuY29tL2dhZGdldHMvMjAxOS8wMi91c2ItMy0yLWlzLWdvaW5nLXRvLW1ha2UtdGhlLWN1cnJlbnQtdXNiLWJyYW5kaW5nLWV2ZW4td29yc2UvP2FtcD0xJmFtcF9qc192PTAuMSN3ZWJ2aWV3PTEmY2FwPXN3aXBl

Base64 decoding that produces:
��"ehttps://arstechnica.com/gadgets/2019/02/usb-3-2-is-going-to-make-the-current-usb-branding-even-worse/��https://arstechnica-com.cdn.ampproject.org/v/s/arstechnica.com/gadgets/2019/02/usb-3-2-is-going-to-make-the-current-usb-branding-even-worse/?amp=1&amp_js_v=0.1#webview=1&cap=swipe

I am not sure what the extra garbage is, but the final URL is clearly there. You could split on https and you would have the URL at index 1 of the resulting array.

Any chance you might be able to use this to get the script working for Google News?

XX-J added a commit to XX-J/Direct-links-out that referenced this issue May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants