Firefox Flash Focus Finally Fixed?

January 11, 2013

This issue has been bothering me for at least half a year, and others too: If you open a page in Firefox that contains Flash content, the current Firefox window will lose the focus to some other window depending on your mood, the moon phase, and the current value of Guid.NewGuid().

After updating to Firefox 18 and Flash 11.5.502.146, this behavior does not show anymore.

Did they really fix? *sigh*

Update 13-01-13

It seems not. I’ll try the fix posted on Mozilla support #929688:

Open Notepad in Administrator mode, and open c:\windows\SYSTEM32\macromed\flash\mms.cfg (32bit) or c:\windows\SYSWOW64\macromed\flash\mms.cfg (64bit), and add the line

ProtectedMode=0

Latest Firefox issues

July 19, 2012

I honestly get more and more reluctant to update each and every piece of software, simply because UPDATES BREAK EVERYTHING.

Most recently example: Firefox.

As a happy user of Firefox since Netscape I occasionally dare to update the software (I mentioned reluctance? I stayed on 3.6.x until an upgrade to 8 or so was unavoidable). The last version that ran smoothly for me was 13.0.

Then came 13.0.1, and problems started: When you opened a link in a new tab, Firefox lost focus after a couple of seconds. From the bug reports I read it seemed to be a problem with the Flash plugins. No rescue in sight.

I noticed that the scrolling was swifter, though. Subjective impression.

I hoped 14.0.1 would solve that focus problem, just to find out that initial scrolling on a page only started after a delay, sometimes a couple of seconds, with CPU usage hogging one core. Plus, the focus problem remained.

I also noticed that the font in the address bar and search bar was a bit smaller, and looked slightly distorted and blurred.

Not amused.

So, back to Firefox 13.0.


Automatically updating Custom DotNetNuke Modules using Selenium IDE for Firefox

May 31, 2012

If you develop DNN modules and need to support several installations in sync, any automated help is welcome.

I tried to use Selenium to automate Firefox to upload module packages into a DNN installation. (I did not find any references as to whether DNN has a built-in update mechanism for custom modules). Download Selenium IDE and press Record.

The result is a Selenium Test Case that performs the following operations

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://localhost/" />
<title>dnn2ml update BGT.Flash</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">dnn2ml update BGT.Flash</td></tr>
</thead><tbody>
<tr>
	<td>open</td>
	<td>http://localhost/dnn/GettingStarted/tabid/83/ctl/Login/Default.aspx?returnurl=%2fdnn%2fMain.aspx</td>
	<td></td>
</tr>

Retrieve the login URL by right-clicking the Login button and copying the URL. The tabid usually changes between installations.

<tr>
	<td>type</td>
	<td>id=dnn_ctr_Login_Login_DNN_txtUsername</td>
	<td>host</td>
</tr>
<tr>
	<td>type</td>
	<td>id=dnn_ctr_Login_Login_DNN_txtPassword</td>
	<td>PASSWORD</td>
</tr>

Edit Host (Superuser) username and password

<tr>
	<td>clickAndWait</td>
	<td>id=dnn_ctr_Login_Login_DNN_cmdLogin</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>//div[@id='dnn_cp_RibbonBar_adminMenus']/ul/li[2]/div/ul/li/ul/li[10]/a/span</td>
	<td></td>
</tr>

I  added these two steps to change to Edit mode (I have no idea how the View/Edit mode is set right after login). This will cause a timeout if DNN is already in Edit mode.

<tr>
	<td>select</td>
	<td>id=dnn_cp_RibbonBar_ddlMode</td>
	<td>label=Edit</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>css=option[value="EDIT"]</td>
	<td></td>
</tr>

Invoke Install Extension Wizard

<tr>
	<td>click</td>
	<td>link=Install Extension Wizard</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=dnn_ctr_Install_wizInstall_cmdBrowse</td>
	<td>C:\path\to\MyModule\packages\MyModule_00.00.01_Source.zip</td>
</tr>

Select package file to be uploaded

<tr>
	<td>clickAndWait</td>
	<td>id=dnn_ctr_Install_wizInstall_StartNavigationTemplateContainerID_nextButtonStart</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=dnn_ctr_Install_wizInstall_chkRepairInstall</td>
	<td></td>
</tr>

This is for updating modules, so we need to check the Repair flag

<tr>
	<td>clickAndWait</td>
	<td>id=dnn_ctr_Install_wizInstall_StepNavigationTemplateContainerID_nextButtonStep</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=dnn_ctr_Install_wizInstall_StepNavigationTemplateContainerID_nextButtonStep</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=dnn_ctr_Install_wizInstall_StepNavigationTemplateContainerID_nextButtonStep</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>id=dnn_ctr_Install_wizInstall_chkAcceptLicense</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=dnn_ctr_Install_wizInstall_StepNavigationTemplateContainerID_nextButtonStep</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>//body[@id='Body']/div[4]/div/a[2]</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=dnn_LOGIN1_loginLink</td>
	<td></td>
</tr>
<tr>
	<td></td>
	<td></td>
	<td></td>
</tr>
</tbody></table>
</body>
</html>

Logout after upload.

Note that this simple script expects the browser to be logged out in DNN.

The sample may be made more stable by using conditions such as provided by Selenium IDE Flow Control.


Chrome, Firefox reset Flash plugin if display: property changes (Update)

May 11, 2012

To resolve the mystery of Flash plugins restarting when their display property changes (directly or inherited), I created a couple of plain and simple HTML files to test a set of operations to toggle visibity in IE 9 (9.0.8112.16421), Chrome 18 (18.0.1025.168 m), and Firefox 12 (12.0).

The Flash player has version 11.1.102.55, and the Flash object is initialized by swfobject.js.

Each of the 3 browsers were tested on 2 different pages with 3 different toggle operations:

  • Page 1 contained the Flash object inside an iframe inside a div.

DOM hierarchy:
<div><iframe><html etc><div class=”flashContent”>

  • Page 2 contains the Flash object inside a div.

DOM hierarchy:
<div><div class=”flashContent”>

The toggle operations were

  • assign a .hidden class setting visibility to hidden
.hidden { visibility: hidden; width: 0px; height: 0px; }
  • assign a .displaynone class setting display to none
.displaynone { display: none; }
  • using jquery .show() and .hide()

.show() actually does not clear the display: property, but sets it to ‘block’, ‘inline’ etc, which might interfere with other operations, such as addClass(“displaynone”), etc.

Results for Page 1 (using iframe):

IE 9 Chrome 18 Firefox 12
toggling top-level div
hidden ok ok ok
display:none ok ok restart
show/hide ok ok restart
toggling iframe
hidden ok ok ok
display:none ok ok restart
show/hide ok ok restart

Results for Page 2 (directly embedded Flash):

IE 9 Chrome 18 Firefox 12
toggling top-level div
hidden ok ok ok
display:none ok restart restart
show/hide ok restart restart
toggling flash object
hidden ok ok ok
display:none ok restart restart
show/hide ok restart restart

The only method to set a Flash object hidden and visible again while keeping the object running turns out to be setting a CSS class with visibility:hidden.

So I put the code (swf inside iframe) that worked in plain HTML files and added it into a DotNetNuke installation. It almost worked.

A new issue occurred: IE9 was not able to display a Flash object once the visibility:hidden style was removed! F12 did not help me to make the object visible again. Strangely though, using JavaScript to re-assign some other iframe to the same src URL caused the Flash to display again!

$("#someotheriframe").attr("src", 
    $("#someotheriframe").attr("src"));

A DNN page simply contains too much generated code (ASP.Net, MS Ajax, DNN framework, jQuery, various controls and .js files) so that I did not think it was worth debugging the issue further. My JavaScript functions to toggle visibility now contain a browser detection based on $.browser to decide which alternative to choose.


Chrome, Firefox reset Flash plugin if display: property changes

May 7, 2012

Working on a web site that dynamically (i.e. upon user action) shows and hides HTML content and Flash content, everything worked as expected in IE9.

When I checked the same page in Chrome 18 and Firefox 12, however, the Flash object would reset everytime I invoked the jQuery .show() method on the object (initialization takes some time for some of the objects I embed).

This behavior has already been mentioned in blogs and support forums.

My solution was to roll-back some of the changes I made, and put the Flash object back to its iframe. Toggling the iframe display does not seem to affect Flash.

Other people worked around this behavior by setting visibility and size, or adding/removing a class that defines display:none.


Firefox and Integrated Windows Authentication

July 23, 2010
  • In the Firefox address bar, type “about:config”
  • Filter to “network.automatic”
  • Edit the setting “network.automatic-ntlm-auth.trusted-uris” to include the web site requiring Windows Authentication.


Found this solution here and here.


Bookmarklet: View MSDN in English

April 15, 2010

If you visit MSDN directly or via a search result, you will be redirected to a location-specific URL containing the language setting, such as en-us or de-de.

Since the machine-generated translations of MSDN range from bad to incomprehensible, I wrote a small Javascript bookmarklet to redirect me to the English original of an MSDN article (tested in Firefox).

Simply right-click on the bookmark bar and select “New Bookmark…”, add a name and this address:

javascript:window.location=window.location.href.replace("de-de","en-us");

Adjust the de-de string to the locale you are typically redirected to. Click OK.

If you visit MSDN again, simply click the bookmarklet to view the MSDN article in English.


Copy Tab URLs in Firefox

February 23, 2010

I have no idea whether this function is common knowledge, but yesterday I discovered that copying the URLs of all open tabs of a window is quite simple in Firefox (3.5).

First, execute Bookmarks, Select All Bookmarks... and save the tabs into a bookmark folder.

Next, locate the new folder in your bookmarks, right-click and select Copy.

The effect is that the clipboard now holds all the URLs contained in the folder.

If you paste as plain text (e.g. Notepad), only the URLs will show. If you paste as rich text (Word, Outlook), you get hyperlinks.

Searching the intertubes brings up a lot of add-ons that might save you a click or two, but its good to know that the function is essentially built-in.


CSS Link List

December 29, 2009

In a web application with its custom CSS that also defined hyperlinks, Internet Explorer would render disabled hyperlinks greyed-out, whereas Firefox showed them as normal text.

Tracking down this different behavior, I found that you can define CSS styles not only by class and tag, but also by attributes using the [attribute] notation:

*[disabled], a[disabled]:hover, a[disabled]:visited
{
color:gray;
}

If you are looking for CSS definitions for fixed headers, footers and sidebars, take a look at these sample CSS. I’m thinking about including them in the next version of dbscript.


Solving Firebug’s “Unable to show styles”

November 8, 2009

I recently installed Firebug to debug some CSS problems, but the only CSS information I got was the message “Unable to show styles”. The link in the message to the FAQ was not very helpful, either.

Fortunately, this post by Ingo was, as it solved this problem.

The problem is caused by a couple of ancient files under the Mozilla Firefox directory belonging to an ancient version of DOM Inspector, which seem to have remained there since the earliest version 1.0x of Firefox, and are easily identifiable by the file date (in my case, the year 2005).

To solve the problem, uninstall Firebug, remove the offending files, restart Firefox and reinstall Firebug.

The files are:

components.ini 
defaults.ini 
chrome\inspector.jar 
chrome\pipnss.jar 
components\inspector.dll 
components\inspector.xpt 
components\inspector-cmdline.js 
defaults\pref\inspector.js 
extensions\Extensions.rdf 
extensions\installed-extensions-processed.txt 
res\platform-forms.css 
res\builtin\platformHTMLBindings.xml 
res\inspector\search-registry.rdf 
res\inspector\viewer-registry.rdf

(list taken from above link, but as I said, you find the outdated files by their age)


Follow

Get every new post delivered to your Inbox.