Live data from Hacker News

Please disable JavaScript to view this site

heydonworks.com

261–270 of 281 posts

Re: Please disable JavaScript to view this site

#261
post #214

javascript-golf challenge: expose the content of heydonworks.com from the browser console using only javascript.

This must be the most unnecessarily awkward way of doing it (have to do it from the console after navigating to the site, so the request is allowed).

    fetch("https://heydonworks.com").then(x => x.text()).then(x => { 
      var f = document.createElement("iframe"); 
      document.body.append(f); 
      f.style.left = "0px";
      f.style.top = "0px";
      f.style.width = "100%";
      f.style.height = "100%";
      f.style.position = "absolute"; 
      f.style.border = 0;
      x = x.replace(/\/gi, ""); 
      x = x.replace(/\.*\/gi, ""); 
      f.contentDocument.write(x); 
    });

Re: Please disable JavaScript to view this site

#263

Earlier quoted context omitted.

You need something to enable the ` ` content to be rendered, like a uBO dynamic rule `no-scripting: $hostname true`. uM doesn't do that.

I think it depends on how you disable it. Anecdotally, I think it’s “if no scripts are executed on the page, render content, but if any scripts at all are executed, don’t”.

Arnavion was actually right. No scripts at all were executed.

Re: Please disable JavaScript to view this site

#264

I must say, I don't understand the disable JS movement. I browse with JS on, and uBlock Origin to block ads. It's rare that I have any javascript-related problems in my web browsing. On the other hand, I definitely use a number of sites that rely on javascript for useful purposes. If you're worried about tracking, you can block ads and tracking scripts without disabling javascript. If you're worried about viruses, we…

I ain’t need no Turing complete sandbox on my box run random code from Internet while I skim through HyperText

CSS is Turing complete.

Re: Please disable JavaScript to view this site

#265

Earlier quoted context omitted.

https does not 100% prevent any of those things.

How can someone spoof the page/inject ads if the site is served over https? They would need to have compromised one of the root certificates on your machine to not give you a giant security warning. In modern browsers there’s not even a button to bypass them (although I know I chrome you can type “this is unsafe” to a hidden input in the error page and it will let you bypass it temporarily).

MITM - https termination at a gateway or proxy.

Re: Please disable JavaScript to view this site

#266

It ought to be possible for the page to disable JavaScript with a meta tag: The browser could put an extra icon next to the https padlock so the user would know they were viewing a document rather than an application.

There seem to be a HTTP header[1] you could use. No icon though. And I'm not sure how much the restriction could be evaded by interactive Turing-complete CSS or similar features.

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Co...

Re: Please disable JavaScript to view this site

#267
post #13

So running untrusted code on your computer is a bad thing. Well, it should be in a sandbox, but that has many intentional and proably some less intentional holes to do stuff on your machine. So how do I trace what Javascript is doing on my machine? Generally mitmproxy gives a feeling what sites the browser talks too. And strace gives often a good feeling what a Linux binary does. But the browser is too big and compli…

> Can anybody recommend a tool to look what Javascript code loaded by a certain page is doing? Open your browser's developer tools, go to the Script/Debugger tab and have at it. It's just about as obtuse to use as a tool as gdb, but you'll see exactly what it does. Chrome dev tools has automatic formatting of the code, maybe firefox too. But you'll be stuck with shitty variable names if they been mangled. Although yo…

[deleted]

Re: Please disable JavaScript to view this site

#268
post #34

Earlier quoted context omitted.

> Can anybody recommend a tool to look what Javascript code loaded by a certain page is doing? Open your browser's developer tools, go to the Script/Debugger tab and have at it. It's just about as obtuse to use as a tool as gdb, but you'll see exactly what it does. Chrome dev tools has automatic formatting of the code, maybe firefox too. But you'll be stuck with shitty variable names if they been mangled. Although yo…

> It would be interesting to have a browser tool that is like strace and you could filter by calls, so you can see exactly where window.navigator is being used for example, or localStorage.setItem. Exactly, that's what I meant.

Note that javascript can access whether developer tools are open and change it's behaviour. Or so I've heard.

Re: Please disable JavaScript to view this site

#269

Earlier quoted context omitted.

I generally visit web pages with JavaScript disabled and them immediately click "reader view". But there are certainly a lot of sites where content is loaded with script, and for those pages I must enabled JS. Q: Does anyone know of a Safari iOS add-in that allows for whitelisting of specific sites to run JS?

Not sure if this solves your entire problem, but you can disable all content blockers for any sit in Safari for iOS[1]. [1]: https://www.macrumors.com/how-to/disable-content-blockers-sa...

So what I should then be looking for is a good content blocker - one that supports disabling JavaScript. Any recommendations?

Re: Please disable JavaScript to view this site

#270

Earlier quoted context omitted.

Not sure if this solves your entire problem, but you can disable all content blockers for any sit in Safari for iOS[1]. [1]: https://www.macrumors.com/how-to/disable-content-blockers-sa...

So what I should then be looking for is a good content blocker - one that supports disabling JavaScript. Any recommendations?

No clue on that one, sorry. I’ve been using Purify[1] for ages, but have no clue if it blocks JS - I suspect it blocks only some JS, because my experience of the web isn’t trash while using it, but I do have to disable it sometimes to use the heavily animated navigation systems that some sites implement.

[1]: https://apps.apple.com/us/app/purify-block-ads-and-tracking/...

Post reply on HN