0

I am playing with a greasemonkey script where I want invoke a method on a website. This method will open a popup. How can I enforce that this popup will been displayed? I am doing nothing evil, I just try to call login() on this site.

Here is my code:

if(location.href=="http://rekire.github.io/SmokePreview/auth.html") {
  login(function(data) {
    console.log("Wohoo", data);
  }, function(data) {
    console.log("Oh no!", data);
  });
  return;
}

I do not really want to override user settings to allow that popup if you have an idea please give me a hint.

rekire
  • 47,260
  • 30
  • 167
  • 264
  • Greasemonkey still cannot do this. The user will have to click the "Allow popups for this site" message. (But they only have to do that the first time.) Alternatively, call the login code from within a link (which the user must click) or rewrite `login()` to use a flyover iframe instead of a popup. ... This would make a good feature to add to Greasemonkey, but the controlling developer rejects these kinds of "risky" additions. – Brock Adams Dec 29 '15 at 00:40
  • Also related: http://stackoverflow.com/questions/4609936/how-a-bookmarklet-can-avoid-the-popup-blocker – Brock Adams Dec 29 '15 at 00:41

0 Answers0