Prevent a user from exiting from firefox using js [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
how can I prevent user exit firefox?
I want that user woldn`t leave page before all required fields are filled.
I would be happy to see full example...
Thanks

You can't stop someone from closing the browser, or navigating away from the page, if that's what they want to do. It's their browser - you can't force them to do anything.
That said, you can pop up a message by hooking the onbeforeunload event and returning a string if there are still actions you want them to perform. Most browsers will then display this string in a dialog asking whether they really do want to navigate away (or close the browser etc), however the Firefox devs have taken the stance that that is a security risk and will only present a generic message instead. Even with this in place, the user can still choose to close the browser or navigate away.

Related

Keep browser window always on top for a valid use case [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm looking for a reliable way to get a browser window always on top. I know some old methods like window.focus(), blur events and so on but they don't work anymore.
I was wondering if there is some kind of way to get the user trust to keep a specific browser window always on top on the desktop.
The use case is simple. I'm letting the user to capture and record their screen and I want to let them record their face as well. For that, I'm opening a popup (window.open) and enabling their webcam. This window must be always on top in order to get their face always visible when the user is managing other windows.
Is this achievable? Thanks!
I don't think what you're asking for exists, no.
The closest that I can think of is the fullscreen API, but that won't work for your use case — it sounds like you want other windows to be visible, just not on top.
I think you'll have to use user training to get the best results you can, telling them to be sure that their face is visible and not behind some other window.

detect browser refresh/F5/right click reload in angular 5 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have a requirement where, Users inputs something and submit then angular does a service call which returns if users input is valid/invalid. If valid take user to success page, if service returns invalid/bad input then user needs to be taken to failure page and should never be able to go back(using back button) or user refresh the page, user should still be on same page. Only option provided to the user should be close browser, there by not allowing using to submit one more request(leading to service call).
You cannot prevent the user from not running or editing client-side JavaScript code. Since this is a security requirement against the interest of that particular user, the solution must be server-side:
On the server, after getting the wrong answer, mark the user's profile as such. You may need an additional table in your database joining users and questions for that.
Whenever the user loads the question or submits it, first check the user's flag. If it's set, error out immediately.
Note that this behavior is quite hostile to the user. For instance, the user may accidentally touch Enter too soon, and will be shut out by your system.

Program to repeatedly get the contents of a webpage [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I wish to get the contents of a web page that requires me to be logged in (and one that I do not have control over: e.g. Twitter or Facebook), for example I can have Chrome running and I can see Ajax updating the page updating, but I want to periodically get the contents of this page and somehow save it. I don't mind leaving a computer running to achieve this...
You can use any http software to achieve this (like curl). Depending on the site it will take some investigation of how requests are made, in what order, the post data, the encryption, the user agent, cookies, headers, etc. etc.
It could take some time to find the right recipe.
Generally these sites don't want you to do this though, so don't be surprised when you run up against captcha or other clever methods from preventing exactly what you're trying to do.
Chances are, if you have to ask, you won't get in. But have fun.

How to open a new web page and prepopulate form fields [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to make it easy for people to fill out this form http://parkplanning.nps.gov/commentForm.cfm?documentID=55416 by opening it in a new window and having some of the fields pre-populated. I don't own that form, so I can't change it - and it must be opened in the user's browser as I'm sure they check IP addresses for the submission.
I'm not sure how the best way to do this would be. I'm guessing javascript? Any suggestions/pointers?
Seems like I need to perform cross-site scripting. Is that doable via frames or something?
If you're just having the page open in a new tab or frame, then you can't do anything. As you said, you don't own the form, and can't change it. They probably don't check IP addresses for the submission, but it's not ethical to spoof, and it's extremely unethical to do any cross-site scripting.

Does a timer keep firing in a mobile browser after the device is put to sleep? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a repeating timer on a page. If the page is being viewed on a mobile device (like iphone), and the user sleeps the phone, does the browser keep executing the timer?
I'm worried about users leaving this page open, sleeping the phone, then the timer just keeps firing forever until they close the page or navigate away from it.
Thanks
I also think it stops, but just to make sure why not leverage the Visibility API? The page is certainly not visible if the activity is not showing or the user is using another tab.
http://www.html5rocks.com/en/tutorials/pagevisibility/intro/

Categories