1

I know that we can create a bookmark with javascript: somecodegoeshere; and we can use it to add some JavaScript for our client side as KickAss does.

But is it possible to create url to some page, e.g. youtube and include in this url script like kickass?

Ryba
  • 25
  • 4
  • please elaborate more, why would you need javascript for this? A bookmark IS an url to some page. – Alexander Kludt Mar 04 '22 at 15:05
  • Are you asking whether you can create a URL/link that will point _other_ people towards YouTube, and then execute JavaScript code of your choice within that page? Of course that is not possible, that would open the door for all kinds of attacks, like stealing passwords the user will type into login forms, etc. – CBroe Mar 04 '22 at 15:05

1 Answers1

3

No. What you are asking for is, essentially, an XSS attack.

XSS attacks depend on server vulnerabilities to read the data from the URL and inject it into a page in such a way that the browser executes that data as JavaScript.

They are a major security problem. Browsers do not aim to enable them.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335