This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to close window in firefox using javascript?
i want to close the main Firefox browser window that a user is browsing my site to close automatically using JS.
i came to know that setting dom.allow_scripts_to_close_windows = true in C:\Program Files\Mozilla Firefox\greprefs\all.js will allow this. Please let me know if it is possible to ovrwirte this value using our Javascript.
By default, a browser will only let you close windows via script which were themselves originally opened via script.
It is not possible to modify that value via JS in your page, and should not be. Imagine the implications of allowing a page to modify user preferences...
No. Websites cannot change the user's preferences.
No, you cannot change a browser configuration via JavaScript.
Related
This question already has answers here:
disallow window open in javascript
(2 answers)
Override window.open()
(1 answer)
Closed 4 years ago.
I want to get rid of the window.open function. Is it somehow possible to override or deactivate this function?
I fact a want a browser in which the function window.open is not implemented at all. And I want a browser which is not able to load any resource which comes from another host than that one typed into address bar. (I know that many pages would not work any more in that browser.) But I know I will not get.
Sometime I visit a page that uses window.open by onclick for advertisement. I’m not against advertisement, but against unwanted pop-ups.
I want to inject those pages with my own JS to disable open().
This question already has answers here:
How can we open a link in private browsing mode
(2 answers)
Closed 8 years ago.
Is there a way, via Javascript or other code, to open a url in a private/incognito window from an HTML page? Ideally cross-browser or at the very least IE and Firefox.
The anticipated behaviour would be along the lines of
Link
The simplified reason for this is because admins want to be able to log in as users to preview various pages, but without logging themselves out. Whilst there are various other ways around this issue, this would be the simplest (assuming it is possible).
We can't force the visitor to view the page in an incognito/private window. Browsers provide no API that would make that possible outside of an extension.
This question already has answers here:
How to change URL in browser without navigating away from page?
(2 answers)
Closed 9 years ago.
I've navigated a lot through the github website. I've observed that whenever I click on a link, the page does not refresh and even the URL in the browser is changed. Moreover, those links are added in the history!
Well, I know that AJAX is a way to go and I know a lot of JavaScript(semi-intermediate level coder) but you can't change the URL with Ajax. Neither can you make those URLs be visible in the history.
So, how the heck do they do it?
There's a lot of tools out there to make this process easy nowadays, check out HistoryJS and NavJS.
Microsoft released an example application harnessing these technologies a while ago named "Big Shelf", which seems to have been taken down unfortunately. Obviously that's only relevant if you're using .NET.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Programmatically open new pages on Tabs
I have a link in my page and i want it to be opened in a new tab when the user clicks it?
That depends on the users browser settings. You can't control that as far as I know. All you can do is get it to open in a new windows, but if the user has his/her browser setup to open new windows in a new tab, it will do that.
So basically, the best you can do is open in a new window.
target="_blank"
i.e.
link text here
Most browsers treat a _blank target as opening in a new tab.
Set the target to _blank:
Use the target attribute set to _blank:
example
The exact behavior depends on the browser and user settings, so this is the best one can do.
This is considered bad practive because you (the web developer) is trying to control what the users browser is doing. It should be up to me how I want to open the link. Other than that lecture (and I understand that this may not be your decision), it doesn't seem that there is a way to do this.
This question already has answers here:
Facebook Connect Dialog Popup
(2 answers)
Closed 8 years ago.
I want it to have a popup dialog javascript box. Instead of a new window.
I've seen it before. How can I get it?
Thanks.
Unfortunately, Facebook prohibits using a javascript pop-up instead of a new window. Until early this year, they weren't doing anything to block it, so some sites were doing it that way.
Now they've started detecting when they're in an iframe and are putting up a black overlay that, when clicked, opens their login in a new window. At least their implementation still allows sites that are doing it the "wrong" way to work with no changes, but it's frustrating.
It's possible to work around this using their mechanisms for client authentication, but that involves your web site prompting for the user for their Facebook password which is a horrible idea for security and privacy reasons as well as an explicit break of Facebook TOS.