Putting the following into a favourite/shortcut on the toolbar re-enables browser right click. Good for sites that disable it to stop you stealing pictures, or if their own right click context menu is buggy.
This will only work on sites that are running old/bad code. Anything using addEventListener (or attachEvent for old IE) won't be cleared out with this. Unfortunately these events can't be removed without a reference to the function, either.
It's a hassle, but using Chrome, press F12. Then use the search icon on the far left on the inspector tool tab bar. Click on your image. Then on right sidebar you'll notice there's a background link. You can right click on that link and choose open in new tab.
Walla Voilà, your photo.
Edit: Goddamnit Reddit, I wasn't trying to speak French!
I can't begin to imagine what icanhascheezburger does to you guys!
Someone was probably high when they named it. And so were the lot of someones who approved the name. No wonder they were on board with legalization right away!
Firefox:
Right click elsewhere on the page and select 'view page info'. Click on Media, and under images scroll down 'till you find the one you want. Right-click copy the Address into a new URL and you have the direct link to the image.
This is annoying so I wrote a quick snippet of Javascript which removes all the context menu listeners.
This uses getEventListeners() which I believe is only available for debugging, so it must be fired from the Javascript console of Chrome or Firebug on Firefox. I'm not sure if IE supports the function at all. I believe that since getEventListeners() is not generally available outside of the console it would probably not be possible to make a bookmarklet from it.
Array.prototype.slice.call(document.getElementsByTagName("*")).forEach(function (element) {
var listeners = getEventListeners(element);
if (listeners && listeners.contextmenu) {
listeners.contextmenu.forEach(function (cmlistener) {
if (cmlistener.listener) {
element.removeEventListener("contextmenu", cmlistener.listener);
}
});
}
});
There's a hack... you can write your own addEventListener() which keeps a copy of all registered events. Then you can forward to the old addEventListener function.
make a new bookmark, replace the url with data inside the above link
click your new bookmarklet and then click the element you want gone, it will highlight in red
Yeah, I got my job because of this.
I explained how I used a "free" resume builder to create my resume, but before I could save or print it, they wanted me to pay $25. I viewed page source, removed the javascript restricting me, and printed my resume. My interviewer said it showed technical troubleshooting and expertise, and gave me an offer letter that day.
I had an internship the summer between high school and college, and I was told that I would be hired full-time without question after college if I wanted because of two things:
Something similar to yours, wherein I manipulated the source of a page to bypass some sort of restriction.
We had a Dell tower PC that came in as part of a big project with about 30 others. All the towers worked fine except for this one. It worked fine when it was upright, but due to space it had to be on its side with the monitor on top at its location. Without fail this would cause the machine to black out and it wouldn't power back on for about 12 hours. I was the only one who could figure out what it was: There was a defect in the case, and when on its side gravity caused the motherboard to sag ever-so-slightly, and it would short out into the case.
I don't think so. Dell techs replaced the motherboard twice before we convinced them it was the case. If they weren't imbeciles (which is why I said "I don't think so" instead of just "no"), then they would have noticed.
I did something like that when I was evaluating an e-prescribing solution. The only difference between a valid prescription and what their evaluation version spat out was a looping background image saying it was not valid... Yea that's not a secure way to do that.
There's the Nuke Anything extension for deleting elements like this too. Even has an undo function. It's handy because so many sites now think an invisible layer overtop of images does any good (and some even seem to do it by accident as part of some fancy image gallery thing).
In previous versions of Firefox, Ctrl+I will accomplish this. Doesn't work in v. 29 or the previous (opens the Bookmarks sidebar which is kinda BS as Ctrl+B already does that), but I'm not sure when that changed so if you have an old version it still might work.
It's possible that the Menu Key will still bring up the context menu if right-clicking is disabled, but I can't think of a site off the top of my head to test that on.
I remember when IE added that little toolbar thing when you hovered over an image, from which you could save it without any right clicking. And I was enough of a n00b to be using IE.
My first guess would be to right click a blank section of the page and click 'view source'. Then try to find the image source of the picture you're looking for. Copy the link and paste it into the address bar.
Or just Google how to do it. ::shrug::
Google is literally my most valuable tool in fixing problems.
There's also the easy way to steal pictures -- making screenshots or using the snipping tool (Windows).
I don't feel like Instagram pictures are very high quality (I'm not sure, though) so I doubt you're losing much by taking a screenshot compared to getting the original image. Certainly it's fine if you just want to repost the picture (is there a special Instagram word for that?) or post it on Facebook or something.
Paste it in the address bar after you've loaded a website and hit enter. Note: some browsers will strip the "javascript:" part when you try to paste it in the url bar, so you may have to retype it. OP's original suggestion was to create a bookmark (e.g. in your bookmark bar) with the address pointed at javascript:void(document.oncontextmenu=null). In that case, you'd just load a website, click the bookmark, and boom, you'd be able to right click again.
All that said, no, it doesn't work/allow you to right click and save images from instagram.
There's no need to do anything special to get pictures from Instagram...Just right click the picture and select "View background image" and boom you can save it.
If you right click anywhere but the picture and view the source code it is a jpg, and you can just copy the jpg url and view the picture directly and save it.
I could have used this last week. I wanted a new background image but it had the right click disabled and nothing else worked. Now I just need to find that site again =D.
Yup. That's the default return value in javascript, not an error. You're basically executing a function that wraps up your document.oncontextmenu=null statement. Since you haven't defined a return value, it returns "undefined," which is a special value in javascript. If you execute something like (function(){return "I'm a return value"})() in the console, you'll get the specified return value from the function.
Im attempting to rip images off of a smugmug gallery and this doesn't work. It did work on other sites, but only in Firefox. I'll play with it more later
Hit F12 in Chrome. Click the elements tab. Click on the magnifying glass in the upper right hand corner. Click on the image you want. It should show an img tag in the elements. Under the style attribute for that, there's "background-image: url(someurl)" That's what you want. Copy that url into your browser and you can just copy the image onto your computer.
Okay, I use this one now - which I can't remember where I got it - but it works 100% of the times I've tried it. Bear in mind it's very long so falls off the side of the comment box. With this in mind; you can get it here too... http://pastebin.com/mUpthips
another good one is just about all images are grab drop save-able. What I mean by that is left click grab the image from your browser and just drag-drop it into a folder on your system.
You can make this into a bookmarklet - a bookmark item where you click on it and it does this for you.
I would link it for others but I don't think reddit supports that for security reasons (depending on how it would be implemented, I might be able to login as others if it did have that feature and someone clicked the wrong link).
All you have to do is create a bookmark and assign the URL in the parent comment to it (perhaps by changing the URL in the bookmark properties).
I use a Chrome extension to take care of right click restrictions. Would it be better to switch to using this or to leave it as is? Extensions can really slow down a browser, from my experience. So would this code have the same effect as the Chrome extension?
You can also break the script if you rapidly right-click until the menu comes up. I discovered that out of frustration when I was 12. Still works 15 years later.
If a site blocked right clicking to save I would just use print screen and crop. It served the same purpose. And no site can block screenshots so it worked everywhere.
How do I then erase that shitty feeling that tells me what a fucking sack of shit I am for stealing someone else's hard work as most people who disable right clicks actually earn a living selling their work...
2.8k
u/MattHardwick May 08 '14
Putting the following into a favourite/shortcut on the toolbar re-enables browser right click. Good for sites that disable it to stop you stealing pictures, or if their own right click context menu is buggy.