News for hackers. Stuff that matters.
Re:Katamari Hack by Sniffnoy on Saturday October 29, 2022 @04:11AM (#33382052)
How does one use this on modern browers? If I paste it into the Firefox address bar, it interprets it as a search. I can get it to work by stripping off the "javascript:" prefix and pasting it into the console instead, but only on the site itself; if I try it on a different site the request is blocked by browser security measures. Is there any way to get this to work?
Re:Katamari Hack by stavros on Saturday October 29, 2022 @04:44AM (#33382201)
You should create a bookmark with the JS as the target.
Re:Katamari Hack by jakopo87 on Saturday October 29, 2022 @05:12AM (#33382352)
Manually add "javascript:" at the beginning, it gets stripped when you paste it.
Re:Katamari Hack by bmacho on Saturday October 29, 2022 @05:32AM (#33382450)
Put a character in the address bar, paste the text, then ctrl+left for a while then hit delete. (Not like it will do anything, but that's how you can put the text in the address bar.)

Firefox address bar is broken. When you want to copy an url from it (e.g. wikipedia link) it url encodes the text, and makes it unreadable (especially when your language contains non latin characters). I copy links starting form the 't', and manually add the 'h'.

Also when you copy something in the URL bar, then ctrl a then ctrl x, it will copy the original url, instead of your text. But if you do it twice, it will copy your text instead. (Same in windows, linux, even in palemoon.)

It looks like a normal input field on the screen, and it tempts me to use it, but bites me most of the times.

Re:Katamari Hack by jakopo87 on Sunday October 30, 2022 @03:04AM (#33391937)
I tried what you said and it doesn't work with "javascript:" uris (probably to prevent running of unwanted code?).

Firefox bar is not "broken", as every browser I tested has the same behavior, and I think it's because a valid uri should only contain ASCII characters (as described in RFC3896[0]), but I agree with you that it's annoying: it should copy the text as it's displayed.

Fun fact: Internet explorer let you copy the uri "as is" without encoding.

[0] https://www.rfc-editor.org/rfc/rfc3986.html#section-2

Re:Katamari Hack by Cockbrand on Saturday October 29, 2022 @05:40AM (#33382481)
You can also paste it into the JS console in the dev tools (minus the javascript: at the beginning). Still doesn't work for HTTPS enabled sites.
Re:Katamari Hack by j-bos on Saturday October 29, 2022 @07:20AM (#33383027)
Iirc that's a safety feature to tech unsavy users from executing copy pasted code in the url bar. You'll need to manually type

javascript:

at the beginning. Same applies to chrome.

Re:Katamari Hack by Reason077 on Saturday October 29, 2022 @07:42AM (#33383163)
I couldn't get it to work (with random web pages) in Safari.

Trying to paste it to the URL bar gives the error: "Safari doesn’t allow JavaScript from the Smart Search Field. To allow this, choose “Allow JavaScript from Smart Search Field” from the Develop menu."

But even after enabling that option, it still doesn't work. Javascript console shows the errors:

  [Error] Refused to load http://kathack.com/js/kh.js because it does not appear in the script-src directive of the Content Security Policy.
  [Error] Refused to load http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js because it does not appear in the script-src directive of the Content Security Policy.
Re:Katamari Hack by j-bos on Saturday October 29, 2022 @07:52AM (#33383226)
Hmm, I ran into the same issue (without the notification) on chrome and firefox for android..
Re:Katamari Hack by j-bos on Saturday October 29, 2022 @07:57AM (#33383265)
Seems the issue is the request being fired off to get the actual script (xss concerns?), my guess is that it would work by copying the requested script into the js url string, rather than requestimg it.
Re:Katamari Hack by aendruk on Saturday October 29, 2022 @10:31AM (#33384326)
Content Security Policy is a way for websites to ask the browser to disable certain functionality that the website expects to not need. That website evidently has asked the browser to not run third-party scripts.

Ideally your browser would recognize that you, the human, have authority to override the requested policy. Sadly, the days in which your user agent actually acts on your behalf are waning.

Re:Katamari Hack by zaidhaan on Saturday October 29, 2022 @01:02PM (#33385886)
To get it to work, I just copied the contents of both the scripts using the command below and ran it in the developer console.

    wget -q -O - http://kathack.com/js/kh.js http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js | xclip -sel c