Autopaging fix for google/yahoo news images


Autopaging fix for google/yahoo news images


I have been using an auto-paging extension to load the next pages onto the current page, but for search engine results pages, the next page will load but the images won't. Could anybody come up with a script that will load these images?

Some examples:;ylt=AwrE19xD1yddZfAAqQxXNyoA;ylu=X3oDMTE0NXJvcm9wBGNvbG8DYmYxBHBvcwMxBHZ0aWQDQjc2NzZfMQRzZWMDcGl2cw--?p=food&fr2=piv-web&fr=yfp-t


Regarding Google search.

The server response for those subsequent pages simply doesn't have any image on some entries. Those pages have an embedded script to create the images using _setImagesSrc function. To show these images you need to modify the pager extension itself, like it was done in this fork of AP. The original AP also has a similar feature but it runs on the page elements so it can't process the <script> data.

Well, technically speaking it's possible to write a helper userscript but it'll have to re-download each added page and extract the thumbnails from there.

Regarding Yahoo search.

It's possible to write a separate companion script, I didn't test it though.

// ==UserScript==
// @name          Display missing images in yahoo news
// @match*
// ==/UserScript==

document.addEventListener('GM_AutoPagerizeNextPageLoaded', run);

function run() {
  for (const img of document.querySelectorAll('img.s-img[data-src]'))
    img.src = img.dataset.src;

Post reply

Sign in to post a reply.