Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I am building an Extension in firefox which checks the navigated URL, compares it to a list of locally blocked URL's and then decides to block or proceed on with the call.

In order to keep the user occupied, i am trying to use JQuery's blockUI function to block the page till the results of my comparison are complete. However, for some reason, Firefox fires an exception every time i call the blockUI NotSupportedError: Operation is not supported.

The following is my XUL Code
XML
<?xml version="1.0"?>
<?xml-stylesheet href="...." type="text/css"?> 
<!DOCTYPE TestExtension SYSTEM "...">
<overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
		<script src="jquery-1.9.1.js" />
		<script src="jquery.blockUI.js" />
		<script src="background.js" />
</overlay>


The following is how i call the BlockUI within my Background.js
JavaScript
$mb = jQuery.noConflict();
if (flag)
{
   $mb.blockUI.defaults.applyPlatformOpacityRules = false;
   $mb.blockUI(); // FIRES EXCEPTION
}

My firefox version is: 20.0

Any Help is greatly appreciated.
Posted
Updated 3-Apr-13 8:18am
v2
Comments
ZurdoDev 3-Apr-13 14:57pm    
Just a dumb observation, but with the doctype who knows what will happen. Is that doctype intentional?
AspDotNetDev 3-Apr-13 14:59pm    
Haven't really read your question, but maybe you shouldn't self-close script tags (I don't really know what XUL code is, so maybe it doesn't apply)? I have run into a similar problem before: http://www.codeproject.com/Questions/45415/JavaScript-Function-Not-Called-When-Defined-in-Ext
Daroosh 4-Apr-13 4:55am    
Thanks a lot guys, however, this is how a XUL document should look like. XUL is an XML doc type designed to add UI elements to Firefox using its extensions. So, yes, this is how it should look like.

1 solution

Would it be fine for background.js to wrap that offending code within ready block?

JavaScript
$(document).ready() 
{
   if (flag)
{
   $mb.blockUI.defaults.applyPlatformOpacityRules = false;
   $mb.blockUI(); // FIRES EXCEPTION
}
}
 
Share this answer
 
Comments
Daroosh 4-Apr-13 4:53am    
Offending?!
No it's not possible, since this action is not to be performed when the document is loaded, this is only part of a 4000 Line code extension, and as you might possibly understand, i can't really post the extensions code, this is just the part where the error is triggered. It works perfectly fine on Chrome btw...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900