Why IE8 blocking a pop-up window which appears in IE7? - javascript

I am working on a client server application,in which we open client on our pc by URL:http:\[ip of server]:[port no].
My application start by using the URL mentioned in IE, and one pop-up comes in which we perform every action of the apllication and original window we can close as they are only for starting. One of my customer is using IE8 and he is facing a problem in which after clicking on save to bookmark the pop-up is not coming and hence not able to save. In IE7 pop-up as an another window is coming and giving the option to save.
What is blocking the pop-up? Thanks in Advance...

For popups the same goes as for spam email - as the popup developers get smarter, so do the popup blocker developers. As such it makes sense that newer browser versions are stricter in the rules they evaluate to determine when a popup needs to be blocked.
All modern browsers follow the same rules, that all boil down to "popups are only allowed if the user directly initiated them". This means that they guard execution paths, and every call to window.open is caught by the popup blocker unless it can be directly traced to a user action. And as popup developers invented more inventive ways to make a browser think the user initiated it, popup blockers got more inventive in detecting them.
A quite plausible explanation is also that you are developing on a LAN, where IE applies lower security settings by default, allowing more user popups automatically. We cannot see that from your post though.

Related

Allow Firefox AddOn to focus window

I'm trying to write a Firefox AddOn that allows the user to quickly bring a specific open window to the front. While doing research on how to focus windows, I learned that browsers heavily restrict this to avoid misuse. Which I totally support if it is not intended by the user. In my case the user would install the AddOn to explicitly have this functionality, so focusing windows would be intended by the user.
The classic way to do this is Window.focus() but even the Mozilla docs say, that the success of this operation depends on the configuration of the user's browser.
Makes a request to bring the window to the front. It may fail due to user settings and the window isn't guaranteed to be frontmost before this method returns. - Source
In my browser (Firefox 94 on Ubuntu) it doesn't work.
I also read that setting dom.disable_window_flip to true in about:config will enable Window.focus() but it didn't - and it wouldn't be a feasible approach for an AddOn.
Firefox AddOns use a permission system and my expectation would be that there must be a permission that allows focusing windows for this specific AddOn. Unfortunately the permissions aren't very well documented and I couldn't find the right one via trial and error.
Most of the scarce information on focusing windows through AddOns that I found on the web was posted 5 to 10 years ago and doesn't work anymore.
I tried several approaches like calling browser.windows.update(tabId, { focused: true }) from the popup script (which I have a different issue with). I also tried to inject a content script that calls Window.focus() when asked to by a message from the popup script. None of those worked.
So my first question would be: is there any way today (2021, Firefox 94) to allow AddOns to bring a window to front?
And if so: can anyone please show me how?
Thanks in advance!
I think you need to name your window and then focus it.
const newWindow = window.open('http://....', 'NameOfTheWindow');
newWindow.focus();

PWA Chrome cancel window.close() without alert message or default message

Hello we have a question about PWA and window.close events,
Before asking the question we will give some background information why we are asking this question in the first place.
We are trying to rebuild our XUL appllication to a HTML5 one with webcomponents and PWA. In this XUL Application there are allot of pop-ups with there own child windows,the user shouldn't be able to close a parent window while still having edited data inside a child window. This problem is solved when using the beforeunload event on the window object. One small problem you can't really customize this events behavior the user just gets the default message of data loss.The custom message behavior isn't available anymore because the behavior is obsolete since chrome 51.
So far the background of the problem we are trying to solve.
The question,
isn't there any setting inside the PWA manifest.json so you could ask user permission settings to be changed when the PWA is installed and run for the first time. And when this happens the user will be asked to give permission for the window.close event to be cancel-able. When doing this the user confirms to custom or none beforeunload alert pop-ups. This behavior will only be activated if the PWA is installed to the desktop of the user.
Hopefully this is or will be a option.
No, there is no permissions definition in webapp manifest.
(there is something similar for chrome extensions though)
By definition a PWA should behave as a native application, so if you are rewriting software to be a PWA you should re-model your application logic so that it stores the last state of the application on localStorage/indexedDB or similar and reads it upon starting and this would enforce the user to stay on the state you need it. No one should enforce the user to stay with the application open when they don't want.

Is it possible to bypass popup blocking on Safari latest (currently: 10.1.2) when using window.open?

Based on some very useful replies here (like this), I built some code to deal with popup blocking that works fine on other browsers (like Chrome), but not on Safari - loader and target page are just samples, they will be internal documents in the production version:
//redirecting user to a temporary page displaying some loader
test=window.open('https://codepen.io/jackrugile/full/ejsbf/', '_blank');
//setTimeout to simulate some API call
setTimeout(function() {
//this part does not work on Safari to change the new page to target page
test.location.replace('http://google.com');
}, 3000)
I am well aware that popup are evil, they are blocked for a reason and more, but consider I am developing a tool to be accessed and used exclusively inside a given corporate environment, the popup is in the requirements of the company itself and no, we are discussing about too many devices and people with too little technical prowess to think about just disabling the blockers for our own app.
Any tip to make it work on Safari, provided it is possible at all? I might consider dropping the window.open() part, but we need to have a reliable check to verify whether the document was successfully opened or not.

Window.open() reference blocked in IE11

I'm implementing Twitter OAuth sign in in my web app. I'm doing this in a separate window popup, since I read that IFrame is no longer allowed in OAuth. So, as soon I open a new window on Twitter domain, IE sets twitterWindow reference to null. This is due to IE's aggressive Internet zone security settings, which I can't ask from users to disable.
var twitterWindow = window.open(twitterUrl, "TwitterLoginPopup", "width=600, height=600");
When Twitter redirects window back to my domain (after successful or failed authentication), I can see window again and handle the results. But use-case that troubles me is when user closes the window manually and since I don't have its reference, I can't handle that closure.
I tried to implement postMessage() communication between application and window, but that's also impossible without window reference. Does anybody have any workaround for this or idea for different implementation of the OAuth? Thanks in advance.

Enable and Popup blocker in IE

I wrote a scripting logic in using ActiveX. When the application runs it is blocked by popup blocker. When I enabled it works fine, but I want to enable the popupblocker using JavaScript (especially in IE).
Obviously a website cannot modify the popup blocker settings. And that's a good thing.
You should avoid using ActiveX Controls because it is only supported by IE. Trying running your page on Firefox and it won't work.
Now the actual problem -
Firstly you need to understand what ActiveX Objects are used for? They basically allow a web application to interact with the client machine. For example it can use resources on my local hard drive. This is a security risk. So IE gives a warning for the same. You may disable it in your browser by going to Tools-> Internet Options -> Security Tab. Click "Custom Level" and change all the boxes with ActiveX text in it to "Enable".
But it will still show up in your client browsers.
So the point is try finding an alternative for it.
Hope this helps!
You cant. What you could do is have a message on screen which requests the user to turn off the popup blocker .

Categories