News for hackers. Stuff that matters.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by bdg on Friday August 30, 2013 @08:15AM (#6301291)
Websites are growing in their nuisance of DOM-level UI breaking. I'm increasingly using the Inspector dev tool just to delete entire chunks of elements on websites.

"Oh, you need me to click LIKE on your page? ... Deleted!"

"Oh, your news article is 25% of the width of the page and the other 75% is navigation, ads, and other unrelated articles? Deleted!"

"Oh, you have the annoying chat box that hovers in the bottom corner and hides things I actually wanted to see? Baleted!"

I keep telling myself that eventually I'll add a deletion option to the right-click context menu but I never actually bother with it.

Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by zsouthboy on Friday August 30, 2013 @09:41AM (#6301643)
I wrote a bookmarklet to delete stuff like this without opening the inspector:

  javascript:(function(){document.styleSheets[0].addRule(".highlighted_to_remove","background:red !important");var e=function(e){if(e.keyCode==27){i()}};document.addEventListener("keydown",e);var t=function(e){e.stopPropagation();this.classList.add("highlighted_to_remove");return false};var n=function(e){e.stopPropagation();this.classList.remove("highlighted_to_remove");return false};var r=function(e){this.parentNode.removeChild(this);i();e.preventDefault();e.stopPropagation();return false};var i=function(){var i=0;var s=document;while(s=document.body.getElementsByTagName("*").item(i++)){s.removeEventListener("mouseover",t);s.removeEventListener("mouseout",n);s.removeEventListener("click",r);s.classList.remove("highlighted_to_remove")}document.removeEventListener("keydown",e)};var s=0;var o=document;while(o=document.body.getElementsByTagName("*").item(s++)){o.addEventListener("mouseover",t);o.addEventListener("mouseout",n);o.addEventListener("click",r)}})()
Post about it: https://plus.google.com/114437281866675781856/posts/hkp9F9Wr...
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by Lambdanaut on Friday August 30, 2013 @10:10AM (#6301799)
Nice. I think your bookmarklet stretched the hacker news comments page.

Deleted!

Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by Sammi on Friday August 30, 2013 @11:15AM (#6302182)
Works like a charm in Chrome. Not so in Firefox. I'm on a Mac.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by panzi on Friday August 30, 2013 @05:53PM (#6304465)
So did I!

    javascript:var cursor = document.body.style.cursor; document.body.style.cursor = "crosshair"; var killer = function (event) { document.body.style.cursor = cursor; if (event.target.parentNode) event.target.parentNode.removeChild(event.target); window.removeEventListener('click', killer, false); event.stopPropagation(); event.preventDefault(); }; window.addEventListener('click', killer, false);void(0)
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by panzi on Friday August 30, 2013 @07:04PM (#6304734)
Improved version:

    javascript:(function(){var e=document.body.style.cursor;document.body.style.cursor="crosshair";var t=document.createElement("div");var n="border:1px solid #3280FF;background-color:rgba(50,128,255,0.5);position:absolute;z-index:999999999999999;display:none;";var r="pointer-events:none;";var i="transition:width 60ms,height 60ms,left 60ms,top 60ms;";n+=r+"-webkit-"+r+"-moz-"+r;n+=i+"-webkit-"+i+"-moz-"+i;t.setAttribute("style",n);document.body.appendChild(t);var s=null;var o=function(e){var n=e.target;if(n!==s&&n.parentNode){var r=n.getBoundingClientRect();var i=document.documentElement;var o=document.body;var u=i.clientTop||o.clientTop||0;var a=i.clientLeft||o.clientLeft||0;var f=window.pageYOffset||i.scrollTop||o.scrollTop;var l=window.pageXOffset||i.scrollLeft||o.scrollLeft;var c=l-a+r.left-1;var h=f-u+r.top-1;t.style.display="block";t.style.left=c+"px";t.style.top=h+"px";t.style.width=r.width+"px";t.style.height=r.height+"px";s=n}};var u=function(n){document.body.style.cursor=e;if(n.target.parentNode)n.target.parentNode.removeChild(n.target);if(t.parentNode)t.parentNode.removeChild(t);window.removeEventListener("click",u,false);window.removeEventListener("mouseover",o,false);n.stopPropagation();n.preventDefault()};window.addEventListener("mouseover",o,false);window.addEventListener("click",u,false)})();void(0)
"Source": http://jsfiddle.net/udzP3/
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by durzagott on Friday August 30, 2013 @10:58AM (#6302098)
Thank you for this! It looks pretty awesome.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by Keyframe on Friday August 30, 2013 @10:13AM (#6301817)
Readability is your friend! http://www.readability.com/apps
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by rspeer on Friday August 30, 2013 @07:14PM (#6304761)
I've never been able to get Readability-the-app to work on most sites. It seems far less useful than the original bookmarklet. I also don't want to send things to my "Reading List" or my imaginary Kindle.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by qu4z-2 on Monday September 02, 2013 @10:44PM (#6318438)
For fans of the original bookmarklet: [http://readable.tastefulwords.com/]
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by pessimizer on Friday August 30, 2013 @10:45AM (#6302016)
Remove It Permanently

https://addons.mozilla.org/en-US/firefox/addon/remove-it-per...

Based on Aardvark; fixes the web.

Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by anoncow on Friday August 30, 2013 @01:58PM (#6303183)
Eventually, this will become a crime and we, programmers, will support it. Because, legislating our way to money is easier. Locking down is easier.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by nollidge on Friday August 30, 2013 @12:42PM (#6302711)
AdBlock's pretty good at handling this stuff too.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by tripzilch on Friday August 30, 2013 @07:13PM (#6304758)
You might enjoy this "position:fixed fixer" bookmarklet I wrote, it just sets all elements with position:fixed to position:static. In 99% of the cases this does exactly what is needed to improve the page, without even having to manually click or select the elements.

    javascript:for(var a=document.querySelectorAll('*'),i=0,e; e=a[i]; i++) if (e.currentStyle.position == 'fixed') e.style.position = 'static'; void(0)
I have it named "fix", so I can just type "fix" in the address bar and it applies to the current page. It's lovely, all those floating fixed elements just disappear (possibly somewhere to the bottom of the page) and you get your screen estate back.

edit: I just see a bunch of others also made bookmarklets to remove elements, so I added a bit more description as to why mine is different. Setting all position:fixed elements to position:static really does seem to do exactly what you want in one fell swoop, in 99% of the cases.

Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by mavhc on Friday August 30, 2013 @08:50AM (#6301400)
There should be an adblocker list for popups, survey requests, etc
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by Sprint on Friday August 30, 2013 @08:53AM (#6301415)
Just disable Javascript by default, it will protect your sanity.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by Dirlewanger on Friday August 30, 2013 @09:27AM (#6301566)
But also nearly cripple a site's functionality aside from static content pages.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by chestnut-tree on Friday August 30, 2013 @03:31PM (#6303728)
"But also nearly cripple a site's functionality aside from static content pages.

Even plain text pages aren't immune from the Javascript curse. I've said this before, but Google's blogger/blogspot service is one of the worst offenders. For example, here is the official Android blog from Google

http://officialandroid.blogspot.co.uk/

With Javascript disabled, nothing loads at all. When Javascript is enabled, you get a mostly text page that could easily be served without Javascript.

Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by Sprint on Friday August 30, 2013 @09:31AM (#6301585)
As you can easily re-enable it with any decent browser (Opera 12 is great) that is no issue since if you actually want to have a site to have interactive features on its pages, just enable it. Otherwise, you get soothing, plain, static content. Most sites to not require Javascript for reading text or looking at images.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by k3n on Friday August 30, 2013 @11:54AM (#6302419)
It is pretty refreshing to load a page and have it usable within fractions of a second, instead of it having to go and fetch an untold number of external scripts, initialize and create the widgets and objects, etc. Not to mention that sites with auto-play A/V are prevented from blaring at you without your permission.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by Piskvorrr on Friday August 30, 2013 @03:51PM (#6303816)
"Easy" is in the eye of the beholder. "Close tab" is even easier to do; and very little of Internet's content is actually unique (as in "cannot be obtained from a non-scummy site").
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by greenyoda on Friday August 30, 2013 @03:52PM (#6303829)
That's why we have add-ons like NoScript for Firefox (or the similar NotScripts for Chrome) that let you selectively white-list JavaScript from just the sites you need. Even if some site requires JavaScript to load, it almost surely doesn't require JavaScript hosted from Facebook or Twitter or Google Analytics to be functional.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by robert-wallis on Friday August 30, 2013 @01:36PM (#6303066)
Wouldn't it be ironic if the list were hosted by a company who's revenue largely comes from ads. Like most internet companies today.

Maybe some kind of balance would be better than a block list. Effective ads that don't annoy.

Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by mavhc on Wednesday September 04, 2013 @03:21AM (#6326106)
Ads can't be effective, if you'd made a product that was better than what I use, and specifically targeted at me, via magic(?), I'd already know about it because I would have read a review. Ads are just lies. But the question was about popups asking you to sign up, do a survey, etc. I already block ads.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by 59nadir on Saturday August 31, 2013 @04:09AM (#6306181)
I think websites in general are getting away with bloat overall. Ever since I started using noscript I've gotten increasingly annoyed by how every site seems to wanna run scripts from at least 3-4 sources that I know aren't essential to my experience on the actual site. Some sites have upwards of 15 sources and I have to wade through them to allow the content servers, etc..
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by eterm on Friday August 30, 2013 @09:18AM (#6301521)
There must be a market for a chrome plugin that lets one ctrl+click to delete a DOM element, I wonder how hard that would be?
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by antimatter15 on Friday August 30, 2013 @09:26AM (#6301558)
I built this extension a while ago for precisely that reason. https://chrome.google.com/webstore/detail/hide-elements/omjo...
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by DjangoReinhardt on Friday August 30, 2013 @02:01PM (#6303204)
I thought Nuke Anything Enhanced was meant to do exactly that?

Links:

https://addons.mozilla.org/en-US/firefox/addon/nuke-anything...

Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by eli on Friday August 30, 2013 @09:38AM (#6301628)
Might as well just use a Readability-type plugin to pull out the text.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by arikrak on Friday August 30, 2013 @01:58PM (#6303186)
Extensions like Readability and Clearly let you read just the main content on the page. It would be nice if they had an option to automatically load pages like in that mode. Besides avoiding all the clutter websites put, the pages would also load faster that way.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by arikrak on Monday September 09, 2013 @10:05AM (#6353489)
Update: There is an extension like this, called permanent readability: https://chrome.google.com/webstore/detail/permanent-readabil...

(though I think it strips out the junk after the whole page loads.)

Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by ismyrnow on Tuesday September 03, 2013 @12:42PM (#6321954)
I'm pretty sure readability routes web pages through their service to strip them down to the main content, and restyle them. Since this processing isn't done on your machine, it would probably be slower than loading the original page. Also, a company would never invite the amount of traffic such a feature would incur.
Re:Tell HN: Add ?share=1 to Quora URLs to display content wi... by arikrak on Tuesday September 03, 2013 @06:40PM (#6324360)
OK so it would make more sense to use an alternative that does it in the browser, e.g. http://www.notforest.com/.