Hide previously viewed images using a Greasemonkey script - greasemonkey

I'm trying to write a Greasemonkey script that will hide images in Google Image Search that I've already seen (so that I won't be shown the same image in search results twice, when making multiple searches.) Is there any way to obtain a list of images from search results using a Greasemonkey script so that I can prevent the images from loading after they are viewed? In order to do this, I'll need to find a way to prevent images from loading after they've previously been viewed.
var blockedImageList = new Array();
function blockImages(imageList){
//prevent images from loading if they are on the blocked image list,
//which is an array of image URLs
}
function getAllImagesFromPage(){
//add all of the images on the current page to the blocked image list.
}

Related

trigger and fill image upload from url via chrome extension

I'm currently working on a chrome extension that injects a content script into a webpage that allows the user to autofill a form, and everything seems to be working correctly, with the text inputs. But I have not been able to figure out how to upload an image programmatically (simulating user input).
I need help creating a function that takes in a parameter of image url or data uri, and automatically triggers the file upload as if the user uploaded the image manually, to an input selector of my choice. End result should still keep the thumbnail and similar resolution intact.
Scope:
triggers file(image specifically) input automatically. Must include thumbnail and similar resolution intact
must include a parameter for image url/ or data uri
must include a parameter for input selector I target
must work from a chrome extension content script
must work on any file/image input on any page would be ideal
can be written in javascript or jquery, whichever you prefer
An extension that solves this problem perfectly can be found here, so I know this is possible, I just have not been able to replicate it: https://chrome.google.com/webstore/detail/upload-image-from-url/eiglgndkjiabiepkliiemoabepkkhacb. (the code is obfuscated, so I can't figure out how to replicate.

Rendering a user modified page using PhantomJS

My use case is: a user goes onto a webpage and modifies it by either filling in a form, populating the page with data from the database, or dragging around some draggables on the page. He can then download the page he modified as pdf. I was thinking of using PhantomJS to do the conversion from html to pdf.
I understand the basic functionality of PhantomJS and got the basic example working but in all the examples I've seen, either a local file or a url is passed in. Example:
page.open('./test.html', function () { ... }
How would I render the page that is getting modified by a user using PhantomJS? I have 2 ideas:
Have the url change as the user modifies the page, and simply pass in the url. For example, the url contains the position of a draggable div.
Send the modified html to back-end, save it, and run PhantomJS
Do these solutions make sense? I'm hoping there would be a simpler way.

downloading images from webpage with different links

I am trying to download all the images from a webpage. The images are included as follows:
How should I parametrize my wget command to specify that I only want the images where the link starts with "https://alwaysSamePart.com/"? because what follows varies avery time so I cant just specify a hardcoded link.
Ideally I should scrape all the urls af all the images out of the html code. Surf to each link individually and save each image individually.

Display image in a packagedapp/extension after selecting from Google Drive

My packaged app gets images from google drive and then display them on the side. But I can't get the images to be displayed. I am trying to get the url of the image so that I can put that url in an image source. The image url that I am getting is actually an html page rather than jpeg, png etc. I have looked at the reference guide for google picker but nothing seems to work.
I am using this
function pickerCallback(data) {
if (data.action == google.picker.Action.PICKED) {
var fileId = data.docs[0].id;
fileName = data.docs[0].name;
imgURL = data.docs[0].url;
}
I want to use imgURL as the source for image selection but imgURL is not something like "https//:www.example.com/image.jpg. It is rather an html page I want something that ends with file type only then it will be able to display the image. Please let me know how can I get the image to be displayed in html page of my packaged app after selecting it from google drive.
You should fetch the metadata of the image, then use the webContentLink of the image, then the user can view it in a logged in browser. See the documentation on downloads for more information.

Bypassing the Google Image Search

i've been searching for script that can bypass image search in google.
For example...If a image in my site is indexed by google image search then when the google user click on that image a page opens where the image is displayed and my site is shown at the backgrund.
They are many site that can overcome this google indexing and automatically redirect it to the webpage where the image was present.
I'm getting 600 hits a day just by google image results,but i want the users to get images by looking at my site,instead of showing on a popup sort of
I may be over-simplifying, but isn't it a matter of checking if your site is the "top frame"?
if (self.location != top.location){
top.location = self.location;
}
(or some facsimile)
Unless they're embedding custom content within your site's page, in which case you can probably run a script to check for a "known google DOM element" and, when present, do your own hijacking/redirecting.
If you want to force your website to properly load for visitors that come from Google Images, you just need to employ a frame-killing script like the one below.
<script type="text/javascript">
if (top != self) top.location.replace(location);
</script>

Resources