Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't click allow button in flash on firefox

Tags:

flash

firefox

I have a webapp embedding some flash content in an iframe. The flash part is requesting access to the webcam. On firefox/mac os, user's can't click the allow button. This only happens when the page embedding the swf file is loaded in the iframe, it works fine when laded separately. Has anyone else faced a similar problem? Do you know any workarounds?

EDIT: For future reference: we were positioning some stuff via JS and we had positions using "half pixels" (e.g. 20.5px). Once we fixed that everything worked fine.

like image 754
Alex Avatar asked Jun 09 '10 07:06

Alex


People also ask

How do I allow websites to run Flash in Firefox?

In your Firefox browser, type "about:addons" in the address bar and press enter(1). Then on the addons page, locate Shockwave Flash (Adobe Flash Player) and select "Always Activate" from the dropdown menu(2). You can then close the Addons tab and refresh your Digication page to finalize enabling Flash.

Does Firefox still allow Flash?

Adobe and other browsers also ended support for Flash at the end of 2020. Firefox version 84 was the final version to support Flash. Firefox version 85 (released on January 26, 2021) shipped without Flash support, improving our performance and security. There is no setting to re-enable Flash support.

How do I unlock my browser Flash?

Click on Settings and it opens the setting page in a new tab. Click on Site Permissions from the left navigation pane, and click on Adobe Flash. To unblock Flash in Edge, toggle the Block sites from running a Flash button to Ask first.


1 Answers

I found that this bug will also exist in situations when you use margin auto in CSS.

For example, in a fixed width & center aligned layout its typical to use "margin: 0px auto;" to keep a content well centered. This seems to produce possible (likely) decimal left/right margins for the content well. That isn't really a problem for Firefox.. it handles decimal pixel offsets just fine.

But Flash widgets totally seem to freak out when their object container are positioned with decimal pixel values. At minimum, you cannot interact with the "Allow" button. To me, this seems to be the root cause of this bug you will see widely reported by many (as it pertains to FF atleast).

As for why it only occurs in FF, I'm not entirely sure. On my OSX machine, Safari and Chrome don't exhibit this behavior with flash objects. Perhaps all DOM elements in Webkit are rendered with rounded pixel offset values automatically?

For Firefox, I implemented this workaround (useful for center aligned designs):

$(document).ready( function() {
  repositionContentContainer();
});

function repositionContentContainer() {
  // this routine is a complete hack to work around the flash "Allow" button bug
  if ( $("#content").length > 0 ) {

    //Adjust the #content left-margin, since by default it likely isn't an int
    setLeftMargin();
    //If the User resizes the window, adjust the #content left-margin
    $(window).bind("resize", function() { setLeftMargin(); });
  }
}

function setLeftMargin() {
  var newWindowWidth = $(window).width();
  var mainWellWidth = $("#content").width();
  // create an integer based left_offset number
  var left_offset = parseInt((newWindowWidth - mainWellWidth)/2.0);
  if (left_offset < 0) { left_offset = 0; }
  $("#content").css("margin-left", left_offset);
}
like image 60
sghael Avatar answered Oct 09 '22 02:10

sghael