- Registriert
- 3 Aug. 2014
- Beiträge
- 28.543
Nabend,
Link zur aktuellen Version für Firefox, Opera und Chrome:
Chrome: https://chrome.google.com/webstore/detail/googlepanicimages/ofnokbendbpfgbomaepcomeciblhphip
Opera: https://addons.opera.com/en/extensions/details/googlepanicimages/
Firefox: https://addons.mozilla.org/en-US/firefox/addon/googlepanicimages/
ich wollte mal versuchen ob man die Direktlink Funktion bei Google Bilder suche nicht über ein Greasemonkey/Tampermonkey Skript auch indirekt wiederherstellen kann.
Und dies scheint relativ einfach möglich zu sein, zumindest für die Hauptansicht der Google Bildersuche, nicht die "relevante Untersuche" nach ähnlichen Bildern, jenes habe ich nicht eingebaut.
Wenn mit der Maus über ein Bild gefahren wird:
Erscheint ein "View" Link/Button, der bei Klick einen neuen Tab, direkt zum Bild öffnet (Links unten im Bild steht der Link).
Das ganze funktioniert auch für die große Vorschau / Ansicht.
Das funktioniert auch bei dynamisch nachgeladenen Bildern, da das kleine Skript in beliebig einstellbaren Intervallen die Seite auf Änderungen überprüft.
ALT:
Und hier das Skript, auch minimal dokumentiert.
Edit: Alte Version, nur "normale Suche" (nicht jedoch die relevanten Bilder...) - für die relevante bitte die Version aus dem letzten Posting nehmen. Danke.
[src=javascript]// ==UserScript==
// @name Google-Panic-Image
// @version 1
// @author theSplit
// @include https://www.google.*
// @grant none
// ==/UserScript==
// ----------------------------------------------------------------------------------------
// Timings and classname for panic button
// ----------------------------------------------------------------------------------------
// Seconds, when the script should scan the search page for new images
let SECONDS_TO_FIRE = 4
// Our panic class (buttons)
let GOOGLE_PANIC_CLASS = 'Google-panic-image-btn'
// ----------------------------------------------------------------------------------------
// Global variables
// ----------------------------------------------------------------------------------------
let fireAt = 0
let contentHeight = 0
// ----------------------------------------------------------------------------------------
// Gathers all images and adds a "view" link to the direct picture url
function rewampImgs () {
let imgLinks = document.querySelectorAll('a.rg_l')
for (let img of imgLinks) {
let imgURL = img.href.match(/(http|https)%3A.*\.(jpg|jpeg|gif|png|webm)/g)
if (imgURL === null) {
imgURL = img.href.match(/(http|https)%3A.*(\&imgrefurl=http)/g)
if (imgURL !== null) imgURL[0] = imgURL[0].substr(0, imgURL[0].length - 15)
}
if (imgURL !== null) {
let hasControls = false
for (let child of img.parentNode.childNodes) {
if (child.className === GOOGLE_PANIC_CLASS) {
hasControls = true
break
}
}
if (!hasControls) {
imgURL = decodeURIComponent(imgURL[0])
img.parentNode.addEventListener('mouseenter', overlayControls)
img.parentNode.addEventListener('mouseleave', hideControls)
img.parentNode.innerHTML += '<a target="_blank" class="' + GOOGLE_PANIC_CLASS + '" style="visibility:hidden;position:absolute;top:75%;left:5%;background:rgba(0,0,0,0.6);color:#fff;font-weight:bold;padding:5px 10%;border-radius:12px;z-index:999;font-size:12px;text-decoration:none;" href="' + imgURL + '">View</a>'
}
}
}
}
// ----------------------------------------------------------------------------------------
// Function which does schedule the processing
function waitForLoaded () {
if (Date.now() >= fireAt) {
let tmpHeight = document.querySelector('#cnt').clientHeight
if (contentHeight !== tmpHeight) {
contentHeight = tmpHeight
rewampImgs()
}
fireAt = Date.now() + (SECONDS_TO_FIRE * 1000)
window.requestAnimationFrame(waitForLoaded)
} else window.requestAnimationFrame(waitForLoaded)
}
// ----------------------------------------------------------------------------------------
// Display the controls, when the mouse is hovered over the image
function overlayControls (event) {
let img = event.target
for (let child of img.childNodes) {
if (child.className === GOOGLE_PANIC_CLASS) {
child.style.visibility = 'visible'
break
}
}
}
// Hide the controls, if the mouse is moved out of the image
function hideControls (event) {
let img = event.target
for (let child of img.childNodes) {
if (child.className === GOOGLE_PANIC_CLASS) {
child.style.visibility = 'hidden'
break
}
}
}
// ----------------------------------------------------------------------------------------
// Initial run after X seconds after this script was loaded
fireAt = Date.now() + (SECONDS_TO_FIRE * 1000)
window.requestAnimationFrame(waitForLoaded)
[/src]
Das Script als Add-on.
Link zur aktuellen Version für Firefox, Opera und Chrome:
Chrome: https://chrome.google.com/webstore/detail/googlepanicimages/ofnokbendbpfgbomaepcomeciblhphip
Opera: https://addons.opera.com/en/extensions/details/googlepanicimages/
Firefox: https://addons.mozilla.org/en-US/firefox/addon/googlepanicimages/
ich wollte mal versuchen ob man die Direktlink Funktion bei Google Bilder suche nicht über ein Greasemonkey/Tampermonkey Skript auch indirekt wiederherstellen kann.
Und dies scheint relativ einfach möglich zu sein, zumindest für die Hauptansicht der Google Bildersuche, nicht die "relevante Untersuche" nach ähnlichen Bildern, jenes habe ich nicht eingebaut.
Wenn mit der Maus über ein Bild gefahren wird:
Erscheint ein "View" Link/Button, der bei Klick einen neuen Tab, direkt zum Bild öffnet (Links unten im Bild steht der Link).
Das ganze funktioniert auch für die große Vorschau / Ansicht.
Das funktioniert auch bei dynamisch nachgeladenen Bildern, da das kleine Skript in beliebig einstellbaren Intervallen die Seite auf Änderungen überprüft.
ALT:
Und hier das Skript, auch minimal dokumentiert.
Edit: Alte Version, nur "normale Suche" (nicht jedoch die relevanten Bilder...) - für die relevante bitte die Version aus dem letzten Posting nehmen. Danke.
[src=javascript]// ==UserScript==
// @name Google-Panic-Image
// @version 1
// @author theSplit
// @include https://www.google.*
// @grant none
// ==/UserScript==
// ----------------------------------------------------------------------------------------
// Timings and classname for panic button
// ----------------------------------------------------------------------------------------
// Seconds, when the script should scan the search page for new images
let SECONDS_TO_FIRE = 4
// Our panic class (buttons)
let GOOGLE_PANIC_CLASS = 'Google-panic-image-btn'
// ----------------------------------------------------------------------------------------
// Global variables
// ----------------------------------------------------------------------------------------
let fireAt = 0
let contentHeight = 0
// ----------------------------------------------------------------------------------------
// Gathers all images and adds a "view" link to the direct picture url
function rewampImgs () {
let imgLinks = document.querySelectorAll('a.rg_l')
for (let img of imgLinks) {
let imgURL = img.href.match(/(http|https)%3A.*\.(jpg|jpeg|gif|png|webm)/g)
if (imgURL === null) {
imgURL = img.href.match(/(http|https)%3A.*(\&imgrefurl=http)/g)
if (imgURL !== null) imgURL[0] = imgURL[0].substr(0, imgURL[0].length - 15)
}
if (imgURL !== null) {
let hasControls = false
for (let child of img.parentNode.childNodes) {
if (child.className === GOOGLE_PANIC_CLASS) {
hasControls = true
break
}
}
if (!hasControls) {
imgURL = decodeURIComponent(imgURL[0])
img.parentNode.addEventListener('mouseenter', overlayControls)
img.parentNode.addEventListener('mouseleave', hideControls)
img.parentNode.innerHTML += '<a target="_blank" class="' + GOOGLE_PANIC_CLASS + '" style="visibility:hidden;position:absolute;top:75%;left:5%;background:rgba(0,0,0,0.6);color:#fff;font-weight:bold;padding:5px 10%;border-radius:12px;z-index:999;font-size:12px;text-decoration:none;" href="' + imgURL + '">View</a>'
}
}
}
}
// ----------------------------------------------------------------------------------------
// Function which does schedule the processing
function waitForLoaded () {
if (Date.now() >= fireAt) {
let tmpHeight = document.querySelector('#cnt').clientHeight
if (contentHeight !== tmpHeight) {
contentHeight = tmpHeight
rewampImgs()
}
fireAt = Date.now() + (SECONDS_TO_FIRE * 1000)
window.requestAnimationFrame(waitForLoaded)
} else window.requestAnimationFrame(waitForLoaded)
}
// ----------------------------------------------------------------------------------------
// Display the controls, when the mouse is hovered over the image
function overlayControls (event) {
let img = event.target
for (let child of img.childNodes) {
if (child.className === GOOGLE_PANIC_CLASS) {
child.style.visibility = 'visible'
break
}
}
}
// Hide the controls, if the mouse is moved out of the image
function hideControls (event) {
let img = event.target
for (let child of img.childNodes) {
if (child.className === GOOGLE_PANIC_CLASS) {
child.style.visibility = 'hidden'
break
}
}
}
// ----------------------------------------------------------------------------------------
// Initial run after X seconds after this script was loaded
fireAt = Date.now() + (SECONDS_TO_FIRE * 1000)
window.requestAnimationFrame(waitForLoaded)
[/src]
Das Script als Add-on.
Zuletzt bearbeitet: