GooglePlay direct screenshot links

Shows all the screenshots without the scrollbox and adds direct links for fullsized versions

目前為 2017-09-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name          GooglePlay direct screenshot links
// @description   Shows all the screenshots without the scrollbox and adds direct links for fullsized versions
// @include       https://play.google.com/store*
// @version       1.0.3
// @author        wOxxOm
// @namespace     wOxxOm.scripts
// @license       MIT License
// @run-at        document-start
// @grant         GM_addStyle
// ==/UserScript==

var styleAdded = false;

new MutationObserver(function(mutations, observer) {
  if (!styleAdded) {
    styleAdded = true;
    GM_addStyle('\
      .expand-pages-container,\
      .details-section.screenshots .thumbnails-wrapper,\
      .details-section.screenshots .thumbnails {\
          overflow-x: visible !important;\
          white-space: normal !important;\
          height: auto !important;\
      }\
      .expandable .expand-button,\
      .expand-pages-container .expand-page {\
          display: none !important;\
      }\
      .expand-pages-container .expand-page:first-child {\
          display: block !important;\
      }\
      .details-section.screenshots .thumbnails,\
      .details-section.screenshots .thumbnails-wrapper {\
          margin-bottom: 0 !important;\
      }\
    ');
  }
  for (var i=0, ml=mutations.length, m; (i<ml) && (m=mutations[i]); i++)
    if (!m.previousSibling && (m.target.className == 'details-section-body expandable'))
      for (var j=0, nodes=m.addedNodes, nl=nodes.length, n; (j<nl) && (n=nodes[j]); j++)
        if (n.nodeType == 1) {
          var title = document.querySelector('.document-title').textContent.trim();
          var imgs = n.querySelectorAll('img.screenshot.clickable');
          for (var k=0, img; (k<imgs.length) && (img=imgs[k]); k++)
            img.outerHTML = '<a href="' + img.src.replace(/^(.+?)=h\d+.*/,'$1=h900') + 
                             '" title="' + title + ' (' + (k+1) + ')">' + img.outerHTML + '</a>';
          observer.disconnect();
          return;
        }
}).observe(document, {subtree:true, childList:true}); 

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址