Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript jQuery Firefox , +
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 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
$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 3-Apr-13 8:54am
Daroosh659
Edited 3-Apr-13 9:18am
v2
Comments
ryanb31 at 3-Apr-13 14:57pm
   
Just a dumb observation, but with the doctype who knows what will happen. Is that doctype intentional?
AspDotNetDev at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Would it be fine for background.js to wrap that offending code within ready block?
 
$(document).ready() 
{
   if (flag)
{
   $mb.blockUI.defaults.applyPlatformOpacityRules = false;
   $mb.blockUI(); // FIRES EXCEPTION
}
}
  Permalink  
Comments
Daroosh at 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)

  Print Answers RSS
0 OriginalGriff 341
1 Marcin Kozub 225
2 Sergey Alexandrovich Kryukov 220
3 Praneet Nadkar 197
4 Shweta N Mishra 161
0 OriginalGriff 8,149
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 3 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100