javascript: not working in URL bar

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
nop90

javascript: not working in URL bar

Unread post by nop90 » 2020-10-17, 08:32

javascript: does not work in the URL bar.

- Fresh copy with newly generated profile.
- No difference with pref browser.urlbar.filter.javascript
- No difference with pref security.csp.enable
- Tested with: javascript:alert('hi');

Only Alt+Enter works. Spawns new tab and displays "hi" popup.

Version: 28.14.2 (64-bit) Portable

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35636
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: javascript: not working in URL bar

Unread post by Moonchild » 2020-10-17, 09:02

This is a security measure. In fact, it's been that way since single-digit versions of Pale Moon.

If you want to execute arbitrary JS on a page you can use scratchpad, the web console CLI, or even a bookmarklet if you want.
You can also potentially use a data: URI in the address bar although that may change the principal the code is executed as.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked