Page 1 of 1

UniversalXPConnect privileges denied

PostPosted:Tue Dec 16, 2008 12:24 pm
by david
I receive this error message when I\'m trying to copy to clipboard a document url:

Error: A un script de \"http://localhost:8080\" se le han denegado los privilegios UniversalXPConnect.

Freestyle translation:

Error: An script from \"http://localhost:8080\" has been denied the UniversalXPConnect privileges.

What can be causing this?

Thanks in advance,
David

Re:UniversalXPConnect privileges denied

PostPosted:Tue Dec 16, 2008 12:51 pm
by jllort
Do you have any plugin on firefox ( popup killer, add killer or similar ), it could be some antivirus for example that disables javascript script because interprets as a malicius code.

Normally these are the causes that some program - for protecction purposes - blocks RPC javascript calls.

Re:UniversalXPConnect privileges denied

PostPosted:Tue Dec 16, 2008 4:13 pm
by david
No, I haven\'t any plug-ins. Perhaps file permissions...

Re:UniversalXPConnect privileges denied

PostPosted:Wed Dec 17, 2008 12:00 pm
by pavila
To enable javascript Copy to Clipboard buttons on Firefox and Mozilla, enter the following line into browser address bar: \"about:config\"

The list of preferences should open in browser window. Click right mouse button somewhere in active part of preference list window and choose New > Boolean option from context menu. Paste the following Preference name into the New boolean value window input box: \"signed.applets.codebase_principal_support\"

Re:UniversalXPConnect privileges denied

PostPosted:Tue Mar 17, 2009 4:13 am
by wizbang
Thanks Pavila that works great for firefox.

Re:UniversalXPConnect privileges denied

PostPosted:Tue Apr 21, 2009 5:36 am
by softashu
Hi Every one ...

Please help me to solve our problem ..

we are trying to Bookmark our page through \"Bookmark\" link provided on our page ,
for that We have signed that page with script buy NSS \"signtool\" and all certificate and files packed in a Jar file.

It working nice in Local machine . But it not working on web or End User so please give me Solution for enabling that script on web also ..

Below The script we try to use..

function addBookmark()
{
//${pageContext.request.requestURL} var urltest=url.value;
if (navigator.userAgent.indexOf(\'Gecko\') == -1)
{

alert(\"You are in IE Browser \");
var boll =\"${pageContext.request.requestURL}\";
window.external.AddFavorite(boll,\'community forums\');
alert(\"You added \");

}

else
{
netscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");
var bmsvc = Components.classes[\"@mozilla.org/browser/nav-bookmarks-service;1\"]
.getService(Components.interfaces.nsINavBookmarksService);
var ios = Components.classes[\"@mozilla.org/network/io-service;1\"]
.getService(Components.interfaces.nsIIOService);
alert(\"You have granted privelaged from Mozilla Authority\");
//var uri = ios.newURI(\"http://www.example.org/\", null, null);
var uri = ios.newURI(\"http://www.example.org/\", null, null);
var newBkmkId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri, bmsvc.DEFAULT_INDEX, \"example.org\");
}
}



Please reply me we are in trouble

Regards

Ashutosh Kumar
9324177101

Re:UniversalXPConnect privileges denied

PostPosted:Tue Apr 21, 2009 12:01 pm
by jllort
Our actual copy function is:
Code: Select all
function copyToClipboard(text) {
			var ua = navigator.userAgent.toLowerCase();
		   	if (ua.indexOf(\'msie\') != -1 ) {
		   		// the IE-way
		   		window.clipboardData.setData(\"Text\", text);
		   
		   		// Probabely not the best way to detect netscape/mozilla.
		   		// I am unsure from what version this is supported
		   	} else if (ua.indexOf(\'gecko\') != -1 ) {
		   		try {
					netscape.security.PrivilegeManager.enablePrivilege(\'UniversalXPConnect\');
					const gClipboardHelper = Components.classes[\"@mozilla.org/widget/clipboardhelper;1\"].getService(Components.interfaces.nsIClipboardHelper);
					gClipboardHelper.copyString(text);
				} catch (e) {
                    alert(e);
                }
			}
		   
		   	return false;
	   	}
You can take a look at our index.html page at sourceforge.