iPad Safari popup issue - javascript

I am using window.open to open a popup in my page...
Now the issue is the popup gets displayed only if the user has changed the settings to allow popups...
What is the fix if I want to show the popup whether or not the user has blocked/allowed it ?

If a user has blocked popups, your website will not be able to launch them.

Related

Is it possible to inject a chrome extension popup into current webpage without using react?

I'm currently working on chrome extension and I'm dealing with a content injection problem.
In my extension when user clicks the button inside the popup, he has possibility to choose DIV from the webpage he's currently on and then he can return back to popup to choose options for that chosen DIV.
The problem is that I can't force the popup to be open when user clicks outside it (actually I can with open popup console, but it's not a solution here) and the popup.html is reloading every time extension is shown to user.
So I came up with an idea that I can inject a popup into an iframe in the webpage to have control over it's behaviour but I found similar solutions only connected with chrome extensions based on react. Is it possible without any framework?
Any help would be greatly appreciated.

I cannot see the modal pop up when chrome is running via selenium

I am trying to automate filling a form to upload marks of each student.
Scenario when filling the form manually:
Click on a button, modal pop up appears, fill form.
Problem when automated:
Clicking on the button does not open modal pop up.
I tried clicking on the same button manually by adding time.sleep() when chrome is being controlled by automated software, it still doesn't show the modal pop up.
Can the modal pop up be blocked when I try running the form through selenium?
I am running the chrome web driver for v78+
you can check "disable-popup-blocking" option for the google Chrome
Click the Customize and control Google Chrome menu (the three dots in the upper right corner)
Select Settings.
Click Advanced at the bottom.
Under Privacy and security, click the Site Settings button.
Select Pop-ups and redirects.
To disable the pop-up blocker uncheck the Blocked (recommended) box.
To enable pop-ups on specific sites, check Blocked (recommended) and click Add next to Allow and enter the URL(s).

When click a <a> link in chrome extension, how can popup.html keep open state?

I'm doing a Chrome extension about looking though posts from a forum.
Now,I can get some posts' links and I put these links into in my popup.html like this:
post's title
Then when I click the link, a new tab will be opened, but the popup.html page will disappear.
And when I click with pressing , new tab will be opened, but problem still exists.
Now, I want to know if I can open a new tab by clicking a link, and in the meantime I can keep my popup.html page still Show.
I refer to the documentation of chrome extension development, but I still can not solve this problem.
So, can this be realized? And how?
Thanks!
I believe you can't do that with target="_blank", see FAQ Persist Popups
popups automatically close when the user focuses on some portion of the browser outside of the popup. There is no way to keep the popup open after the user has clicked away.
However (thanks to #Bob den os for the idea), you could use chrome.tabs.create with active: false, in this way, the new tab is created without having focus, you can stay the popup open.
chrome.tabs.create({
url: "example.com",
active: false
});
Chrome extensions popup windows require focus to stay open.
How to keep Google Chrome Extension popup open?
It is possible to open the popup window into a new tab. Which does not require focus to stay open.
chrome.tabs.create({ url: chrome.extension.getURL('popup.html')});

JavaScript simulate physical click on a link to bypass pop blocker(Not Jquery)

I am opening a popup after main window load.
Problem:
When user actually click on link the popup opens without complaining anything.
But when I am using Javascript call to click on href, I am getting popup blocker.
I am suspecting that, browser identifies that, popup is opening without any actual operation by user and that's why it is blocking popup.
In herf, I am calling a javascript method to open the popup.
I searched all the questions regarding opening popup and simulating the click like this, these works fine to simulate the click but still getting popup blocker.
Is there any workaround to fool browser?
You can't fool the browser per-se in this scenario. You could however, launch a div as an overlay on the main window if that's an option.

Javascript opening a link

I am trying to open a link in a new tab/window when a user presses a key.
Here is the function I made for opening a link, it gets called when the user presses the "X" key.
function open_link() {
window.open($("#active").attr("link"), '_blank');
}
My page consists of a bunch of divs looking like this, and the user sets the active one by navigating up/down with the keys j/k. All this works, but the problem is that there is a popup blocked warning when the "X" key is pressed to open the link.
<div class="read entry" id="active" entryNumber="0" entryId="733" link="http://www.reddit.com/r/buildapc/comments/1aux43/build_help_ordering_soon_final_review/">
I don't think you can disable popup blocker from javascript. If you could, then popup blockers would be quite useless.
Have you considered using modal divs instead? E.g. modal dialog from jQueryUI.
That is a problem that you can't avoid, popup blocking is a built in function that all the recent browsers have and getting around a pop-up blocker isn't going to get the user happy.
You can use a jquery/javascript alternative like on-request iframes or modal dialog windows

Categories

Resources