Move locales.xml retrieval into try

Fixes "Access to restricted URI denied" issue on Ubuntu
This commit is contained in:
Dan Stillman 2012-01-22 11:23:35 -05:00
parent 94bb513d92
commit 04fb50528c

View file

@ -126,8 +126,8 @@ Zotero.Cite.System.retrieveItem = function(item) {
Zotero.Cite.System.retrieveLocale = function(lang) { Zotero.Cite.System.retrieveLocale = function(lang) {
var protHandler = Components.classes["@mozilla.org/network/protocol;1?name=chrome"] var protHandler = Components.classes["@mozilla.org/network/protocol;1?name=chrome"]
.createInstance(Components.interfaces.nsIProtocolHandler); .createInstance(Components.interfaces.nsIProtocolHandler);
var channel = protHandler.newChannel(protHandler.newURI("chrome://zotero/content/locale/csl/locales-"+lang+".xml", "UTF-8", null));
try { try {
var channel = protHandler.newChannel(protHandler.newURI("chrome://zotero/content/locale/csl/locales-"+lang+".xml", "UTF-8", null));
var rawStream = channel.open(); var rawStream = channel.open();
} catch(e) { } catch(e) {
return false; return false;