Feature Request: "Form may not submit without javascript enabled" alert at the top of pages with javascript-based forms

Bug reports and enhancement requests
Post Reply
theedgeofoblivious
Posts: 3
Joined: Sun Sep 17, 2023 3:45 am

Feature Request: "Form may not submit without javascript enabled" alert at the top of pages with javascript-based forms

Post by theedgeofoblivious »

Spending 5 minutes, 15 minutes, 45 minutes filling out a form and then realizing that it won't submit without javascript enabled is SO frustrating, because we have to fill it out again.

I am colorblind, and can barely see changes to the icon in the menu bar unless I'm looking right at it. If it would be possible to have some kind of notification ON THE PAGE ITSELF like at the top of the form with a big header alert saying "A form on this page may not submit unless javascript is enabled," that could save so much duplicated effort of having to spend sometimes literally hours going through and filling out a form a second time.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.9999.0 Safari/537.36
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: Feature Request: "Form may not submit without javascript enabled" alert at the top of pages with javascript-based fo

Post by barbaz »

Unfortunately it's not technically possible to determine for sure whether a form requires Javascript or not, sorry.

I usually just assume forms require Javascript. If filling out a form takes you "5 minutes, 15 minutes, 45 minutes", it's likely something important and/or sensitive, so you trust the site anyway, don't you? :o
theedgeofoblivious wrote: Sun Sep 17, 2023 3:52 am I am colorblind, and can barely see changes to the icon in the menu bar unless I'm looking right at it.
That seems a significant accessibility issue. Do you think anything in the planned UI redesign might address this? - viewtopic.php?t=25643
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0
theedgeofoblivious
Posts: 3
Joined: Sun Sep 17, 2023 3:45 am

Re: Feature Request: "Form may not submit without javascript enabled" alert at the top of pages with javascript-based fo

Post by theedgeofoblivious »

Wouldn't it be possible to look at the EventListeners for a given form and/or the submit buttons(or other buttons as well) within the form?

It wouldn't even necessarily need to be an onsubmit, just the presence of any kind of eventListener would be an indication that the form might rely on javascript in order to be able to be submitted.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.9999.0 Safari/537.36
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: Feature Request: "Form may not submit without javascript enabled" alert at the top of pages with javascript-based fo

Post by barbaz »

The event listeners don't exist until Javascript is allowed. And they can't be determined in advance: not only is there no way to know how blocked scripts would call addEventListener(), it isn't even possible to be sure where the relevant event listener(s) would get attached - could be a capturing listener higher up in the DOM, could be on the form element, could be only on one or more sub-elements of the form.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0
theedgeofoblivious
Posts: 3
Joined: Sun Sep 17, 2023 3:45 am

Re: Feature Request: "Form may not submit without javascript enabled" alert at the top of pages with javascript-based fo

Post by theedgeofoblivious »

I am familiar with the "creating a web page and using javascript and working with the DOM and javascript" part of things. I actually have pretty extensive familiarity with that, and adding event listeners both within the HTML itself and from within javascript. I've worked with web development since back in the 1990s, and it was a major part of my work up until about 2021.

What I don't have is the familiarity with is the specific way in which the extension disables javascript. I've created Chrome extensions before, but relatively simple ones, and haven't really gone into great detail and worked with things on an ongoing basis. They were mostly just one-offs for very specific purposes in often temporary things.

But in some circumstances, the HTML does contains the "onclick" or "onsubmit" on elements within the form. It wouldn't be possible to check for those and then parse the scripts for addEventListener with the submit button child elements within form elements?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.9999.0 Safari/537.36
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: Feature Request: "Form may not submit without javascript enabled" alert at the top of pages with javascript-based fo

Post by barbaz »

theedgeofoblivious wrote: Sun Sep 17, 2023 9:49 am What I don't have is the familiarity with is the specific way in which the extension disables javascript.
NoScript uses a combination of Content-Security-Policy manipulation and blocking requests via the webRequest API.
theedgeofoblivious wrote: Sun Sep 17, 2023 9:49 am It wouldn't be possible to check for those and then parse the scripts for addEventListener with the submit button child elements within form elements?
Unfortunately not.

It wouldn't be possible to reliably check for onclick or onsubmit because, again, maybe the relevant one could be a capturing listener attached higher up in the DOM, or be dynamically added by a script that is not yet allowed. And generically parsing scripts for whether they do any specific task is not technically possible, not only because there are too many different ways to do any one thing in Javascript, but also because blocked .js files are not even loaded, so not available to parse. And then there is the phenomenon described in viewtopic.php?t=8309 which for this would apply not just to cross-origin scripts, but also to same-site scripts.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0
Post Reply