Improve Firefox/XULRunner Support
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 27 Feb 2012 14:03:51 +0000 (09:03 -0500)
committerDan Scott <dscott@laurentian.ca>
Mon, 30 Jul 2012 14:54:29 +0000 (10:54 -0400)
XULRunner/Firefox 4+ change the rules significantly, and to support them
significant changes have to be made in Evergreen.

This commit covers a number of things:

1 - Remote XUL Issues

Later versions of XULRunner disable support for Remote XUL without using a
whitelist entry, and whitelisting may stop working eventually as well. The
solution here is the addition of a new protocol wrapper that allows Remote
XUL to act like Local XUL.

The wrapper is oils:// and acts like HTTPS for the most part. The "host" the
client connects to is always "remote", however, and use of the wrapper has
multiple effects.

The first of these effects is the enabling of Remote XUL content, with as
close to the Local XUL security level as I could manage. This means that
nearly anything Local XUL can do, Remote XUL should be able to do too.

The second of these effects is the disabling of JavaScript-visible cookies.
XUL doesn't have cookies, and as such a side effect of the wrapper allowing
remote content to appear to be local content is the lack of cookies. This
does *not* affect server side visibility of cookies, however, so things like
TPac can still see cookies. This required fixing a lot of places that were
built to read data like authtokens out of cookies.

The third of these effects is the "hiding" of the hostname for anything
going through the wrapper. This prevents oils_persist from saving things
correctly. I thus made oils_persist check for the wrapper and use the data
stash to get the hostname instead. I suspect that we can get rid of the
location.hostname check entirely at this point, but have not done so.

The wrapper also sets a request header of OILS-Wrapper, value of 'true'.
That allows the server to know that the request came through the wrapper. I
used that ability to have TPac go into "Staff" mode when the wrapper is in
use. This will enhance extension use, where the same authtoken will be seen
by both the staff client and Firefox browsing.

I willi also  note that I rigged the wrapper to be easily adjusted for a
second, hard-coded host for selfcheck use, using oils://selfcheck instead of
oils://remote, that could be very easily turned into a minimal Firefox
extension. That would enable the selfcheck code to have permission to work
with printers and such without enablePrivilege (see next section).

2 - enablePrivilege Deprecation

The enablePrivilege security model has been removed and no longer functions,
and the staff client depended heavily upon it.

The Remote XUL fix provided us with a way to fix the enablePrivilege issues,
however. Because the Remote XUL has the Local XUL security context it
doesn't need enablePrivilege anymore. However, because enablePrivilege no
longer functions for those things *not* loaded through the wrapper some
things had to be changed.

For one, because if you are loaded through the wrapper you can't see
cookies, and if you can see cookies you can't do "XUL" things, the "XUL"
cookie has been removed. However, the wrapper can be detected by the
protocol you are using, so I added protocol checking to the isXUL checks I
know of. I am unsure about what, if anything, to do about the IAMXUL flag
that is set by the browser code, though.

For two, the JavaScript OPAC needs to be passed through the wrapper for some
staff functions to work currently. This has the additional side effect of
effectively forcing SSL mode for JSPac regardless of other settings.

For three, I went ahead and removed all enablePrivilege calls I could find
outside of the selfcheck code. As they no longer work they were just extra
cruft.

3 - Component changes

Component loading has changed significantly, and the easiest way to
accommodate the changes was to re-write our components. The command line
handler and force external components (the latter from another branch of
mine) were simple enough, especially as they aren't interacted with by other
code in the system (and as I wrote them I understood them anyway). While I
was at it I made the force external component more extension-friendly.

The data stash, however, was using a hack to accomplish what a singleton
component could do more easily. That and I couldn't get it to function as
it was. My solution was to re-write it as a singleton, removing the
interface definition that was not needed. As I changed how it functioned so
significantly I had to update all calls to it.

In addition, I hid a window loading routine in the data stash component for
easier loading of a *single* main Evergreen window from the Firefox
overlays.

4 - Extension changes

First off, Venkman, the DOM Inspector, and Chrome List are not guaranteed
compatible with XULRunner anymore. As such, I have removed the out of date
versions. Instead, I have added routines for loading Venkman and the DOM
Inspector as Extensions. This keeps them easy to update to later versions,
and makes us play much nicer when we are an extension. Also, now the
buttons/menu items for loading these interfaces disable themselves if the
extensions don't appear to be loaded.

A side effect of that was that Windows installers compressed with zlib were
unhappy. I switched to solid lzma, which in theory will get us smaller file
sizes too.

Secondly, Extensions have changed significantly in Firefox 4+, and Evergreen
had to be adjusted to deal with some of the changes. I adjusted the overlay
to take into account the new application menu, and I re-wrote the hotkey set
loading routines to deal with the fact that extensions don't get extracted
by default.

5 - Staff Client Build Process

XULRunner has some changes that needed accounting for, such as a root level
chrome.manifest being needed. Extension mode, as mentioned above, needed
tweaks as well, and other issues were run into along the way. Both XULRunner
and Firefox version support has been extended to 14.* and the base XULRunner
download has been bumped to 14.0.1.

In addition to the changes needed to support later XULRunner versions, I
also included alternate application name support and support for OS-specific
branding folders. Mainly because I ended up using all of them in testing,
and decided to leave them in afterwards.

6 - Miscellaneous fixes

MARC View was building a data URL and dumping it into an attribute without
escaping it. Apparently this made XULRunner unhappy, so I added in escaping.

7 - Miscellaneous tweaks

In addition to everything else, while I was running through my various tests
I changed a few other things.

I enabled the navigation buttons on the OPAC interface embedded in the
patron overview for hold placement. With Remote XUL having the same security
context as Local XUL they now work.

I removed all non-SSL authtoken cookie assignments I could find, and flagged
all the SSL ones I could find as being "secure" cookies. On the subject of
cookies, I also told the logoff code to not erase every cookie, as those
running in extension mode might dislike all cookies going away. I know that
during my testing I disliked it, anyway.

I removed the code that messes with the user agent. Extensions are basically
not allowed to do that, and I don't think we need, or should rely on, a
modified user agent elsewhere, so adding a check specifically for when we
are not an extension didn't make a lot of sense to me.

I also made it so that the automatic login command line options will work
after a logoff (but they won't trigger a logoff) during a testing run where
I was logging off, clearing cache, and logging in again repeatedly.

To deal with CSS changes I changed most (but not all) popup elements to
menupop elements. Popups in later XULRunners are transparent by default.

Also for CSS changes, a menubar CSS entry in global.css was causing issues
with menu visibility on Linux. Things look fine without it, so I went ahead
and removed it outright.

In the reporter I found that "class" was being used as a variable name, but
that is a reserved keyword. I changed it to aClass.

To make things easier for url_prefix use I made it so that the urls hash is
checked by the url_prefix function. It looks for names up to the first of
several characters: /, ?, |. If urls contains that name it is replaced into
place. For | the | itself is removed in this process.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
227 files changed:
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/Proxy.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/Proxy/Authen.pm
Open-ILS/src/templates/opac/parts/footer.tt2
Open-ILS/src/templates/opac/parts/header.tt2
Open-ILS/web/conify/global/actor/org_unit.js
Open-ILS/web/conify/global/actor/org_unit_type.js
Open-ILS/web/conify/global/config/copy_status.js
Open-ILS/web/conify/global/config/marc_code_maps.js
Open-ILS/web/conify/global/permission/grp_tree.js
Open-ILS/web/conify/global/permission/perm_list.js
Open-ILS/web/js/dojo/openils/XUL.js
Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js
Open-ILS/web/js/ui/base.js
Open-ILS/web/js/ui/default/acq/common/li_table.js
Open-ILS/web/js/ui/default/actor/user/register.js
Open-ILS/web/js/ui/default/cat/authority/list.js
Open-ILS/web/js/ui/default/serial/subscription.js
Open-ILS/web/js/ui/default/serial/subscription/caption_and_pattern.js
Open-ILS/web/js/ui/default/vandelay/vandelay.js
Open-ILS/web/opac/common/js/RemoteRequest.js
Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/extras/circ/alt_holds_print.html
Open-ILS/web/opac/skin/default/js/rdetail.js
Open-ILS/web/reports/oils_rpt.js
Open-ILS/web/reports/xul/source-setup.js
Open-ILS/web/reports/xul/template-config.js
Open-ILS/web/reports/xul/template_builder.xul
Open-ILS/xul/staff_client/Makefile.am
Open-ILS/xul/staff_client/application.ini
Open-ILS/xul/staff_client/chrome.manifest [new file with mode: 0644]
Open-ILS/xul/staff_client/chrome/chrome.manifest
Open-ILS/xul/staff_client/chrome/chrome_list.jar [deleted file]
Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul
Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_offline.xul
Open-ILS/xul/staff_client/chrome/content/admin/survey_wizard.xul
Open-ILS/xul/staff_client/chrome/content/auth/controller.js
Open-ILS/xul/staff_client/chrome/content/auth/session.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
Open-ILS/xul/staff_client/chrome/content/circ/offline.js
Open-ILS/xul/staff_client/chrome/content/circ/offline.xul
Open-ILS/xul/staff_client/chrome/content/circ/offline_checkin.js
Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js
Open-ILS/xul/staff_client/chrome/content/circ/offline_in_house_use.js
Open-ILS/xul/staff_client/chrome/content/circ/offline_register.js
Open-ILS/xul/staff_client/chrome/content/circ/offline_renew.js
Open-ILS/xul/staff_client/chrome/content/firefox/overlay.xul
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/chrome/content/main/main.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame.xul
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
Open-ILS/xul/staff_client/chrome/content/main/simple_auth.xul
Open-ILS/xul/staff_client/chrome/content/util/browser.js
Open-ILS/xul/staff_client/chrome/content/util/browser.xul
Open-ILS/xul/staff_client/chrome/content/util/clipboard.js
Open-ILS/xul/staff_client/chrome/content/util/deck.js
Open-ILS/xul/staff_client/chrome/content/util/error.js
Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul
Open-ILS/xul/staff_client/chrome/content/util/file.js
Open-ILS/xul/staff_client/chrome/content/util/fm_view.xul
Open-ILS/xul/staff_client/chrome/content/util/list.js
Open-ILS/xul/staff_client/chrome/content/util/list_clipboard.xul
Open-ILS/xul/staff_client/chrome/content/util/mozilla.js
Open-ILS/xul/staff_client/chrome/content/util/network.js
Open-ILS/xul/staff_client/chrome/content/util/print.js
Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
Open-ILS/xul/staff_client/chrome/content/util/shell.js
Open-ILS/xul/staff_client/chrome/content/util/sound.js
Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.js
Open-ILS/xul/staff_client/chrome/content/util/widgets.js
Open-ILS/xul/staff_client/chrome/content/util/window.js
Open-ILS/xul/staff_client/chrome/content/util/xuledit.xul
Open-ILS/xul/staff_client/chrome/inspector.jar [deleted file]
Open-ILS/xul/staff_client/chrome/skin/global.css
Open-ILS/xul/staff_client/chrome/venkman.jar [deleted file]
Open-ILS/xul/staff_client/components/clh.js
Open-ILS/xul/staff_client/components/forceexternal.js
Open-ILS/xul/staff_client/components/inspector-cmdline.js [deleted file]
Open-ILS/xul/staff_client/components/nsIOpenILS.idl [deleted file]
Open-ILS/xul/staff_client/components/nsIOpenILS.xpt [deleted file]
Open-ILS/xul/staff_client/components/nsOpenILS.js
Open-ILS/xul/staff_client/components/oils_protocol.js [new file with mode: 0644]
Open-ILS/xul/staff_client/components/venkman-service.js [deleted file]
Open-ILS/xul/staff_client/external/dojo_template.js
Open-ILS/xul/staff_client/external/template.js
Open-ILS/xul/staff_client/external/template.xul
Open-ILS/xul/staff_client/install.rdf
Open-ILS/xul/staff_client/server/admin/adminlib.js
Open-ILS/xul/staff_client/server/admin/circ_age_to_lost.js
Open-ILS/xul/staff_client/server/admin/copy_locations.js
Open-ILS/xul/staff_client/server/admin/do_not_auto_attempt_print_setting.js
Open-ILS/xul/staff_client/server/admin/font_settings.xul
Open-ILS/xul/staff_client/server/admin/hold_pull_list_classic.js
Open-ILS/xul/staff_client/server/admin/index.xhtml
Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js
Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul
Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.js
Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.xul
Open-ILS/xul/staff_client/server/admin/printer_settings.html
Open-ILS/xul/staff_client/server/admin/printer_settings.js
Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js
Open-ILS/xul/staff_client/server/admin/toolbar.js
Open-ILS/xul/staff_client/server/admin/transit_list.xul
Open-ILS/xul/staff_client/server/admin/upload_xacts.js
Open-ILS/xul/staff_client/server/admin/work_log.js
Open-ILS/xul/staff_client/server/admin/work_log.xul
Open-ILS/xul/staff_client/server/cat/bib_brief.js
Open-ILS/xul/staff_client/server/cat/bibs_abreast.js
Open-ILS/xul/staff_client/server/cat/bibs_abreast.xul
Open-ILS/xul/staff_client/server/cat/copy_browser.js
Open-ILS/xul/staff_client/server/cat/copy_browser.xul
Open-ILS/xul/staff_client/server/cat/copy_buckets.xul
Open-ILS/xul/staff_client/server/cat/copy_buckets_quick.xul
Open-ILS/xul/staff_client/server/cat/copy_editor.js
Open-ILS/xul/staff_client/server/cat/copy_notes.xul
Open-ILS/xul/staff_client/server/cat/copy_summary.xul
Open-ILS/xul/staff_client/server/cat/manage_multi_home_items.js
Open-ILS/xul/staff_client/server/cat/manage_multi_home_items.xul
Open-ILS/xul/staff_client/server/cat/marc_new.xul
Open-ILS/xul/staff_client/server/cat/marc_view.html
Open-ILS/xul/staff_client/server/cat/marc_view.xul
Open-ILS/xul/staff_client/server/cat/marcedit.js
Open-ILS/xul/staff_client/server/cat/marcedit.xul
Open-ILS/xul/staff_client/server/cat/record_buckets.js
Open-ILS/xul/staff_client/server/cat/record_buckets.xul
Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul
Open-ILS/xul/staff_client/server/cat/spine_labels.js
Open-ILS/xul/staff_client/server/cat/util.js
Open-ILS/xul/staff_client/server/cat/volume_buckets.xul
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
Open-ILS/xul/staff_client/server/cat/volume_copy_editor.js
Open-ILS/xul/staff_client/server/cat/volume_copy_editor.xul
Open-ILS/xul/staff_client/server/cat/volume_copy_editor_horiz.xul
Open-ILS/xul/staff_client/server/cat/volume_editor.js
Open-ILS/xul/staff_client/server/cat/z3950.js
Open-ILS/xul/staff_client/server/cat/z3950.xul
Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js
Open-ILS/xul/staff_client/server/circ/checkin.xul
Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/checkout.xul
Open-ILS/xul/staff_client/server/circ/circ_brief.xul
Open-ILS/xul/staff_client/server/circ/circ_summary.xul
Open-ILS/xul/staff_client/server/circ/copy_details.xul
Open-ILS/xul/staff_client/server/circ/copy_status.js
Open-ILS/xul/staff_client/server/circ/copy_status.xul
Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul
Open-ILS/xul/staff_client/server/circ/in_house_use.xul
Open-ILS/xul/staff_client/server/circ/missing_pieces.js
Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul
Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
Open-ILS/xul/staff_client/server/circ/print_list_template_editor.xul
Open-ILS/xul/staff_client/server/circ/renew.xul
Open-ILS/xul/staff_client/server/circ/renew_overlay.xul
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/index.xhtml
Open-ILS/xul/staff_client/server/main/data.xul
Open-ILS/xul/staff_client/server/main/gen_offline_widgets.xul
Open-ILS/xul/staff_client/server/main/simple_auth.xul
Open-ILS/xul/staff_client/server/main/ws_info.xul
Open-ILS/xul/staff_client/server/patron/barcode_entry.xul
Open-ILS/xul/staff_client/server/patron/bill2.js
Open-ILS/xul/staff_client/server/patron/bill2.xul
Open-ILS/xul/staff_client/server/patron/bill_cc_info.xul
Open-ILS/xul/staff_client/server/patron/bill_check_info.xul
Open-ILS/xul/staff_client/server/patron/bill_details.js
Open-ILS/xul/staff_client/server/patron/bill_history.js
Open-ILS/xul/staff_client/server/patron/bill_wizard.js
Open-ILS/xul/staff_client/server/patron/display.js
Open-ILS/xul/staff_client/server/patron/display.xul
Open-ILS/xul/staff_client/server/patron/display_horiz.xul
Open-ILS/xul/staff_client/server/patron/hold_details.js
Open-ILS/xul/staff_client/server/patron/holds.js
Open-ILS/xul/staff_client/server/patron/holds.xul
Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
Open-ILS/xul/staff_client/server/patron/info_group.js
Open-ILS/xul/staff_client/server/patron/info_group.xul
Open-ILS/xul/staff_client/server/patron/info_notes.xul
Open-ILS/xul/staff_client/server/patron/info_stat_cats.xul
Open-ILS/xul/staff_client/server/patron/info_surveys.xul
Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/items.xul
Open-ILS/xul/staff_client/server/patron/items_overlay.xul
Open-ILS/xul/staff_client/server/patron/place_hold.js
Open-ILS/xul/staff_client/server/patron/search_form.xul
Open-ILS/xul/staff_client/server/patron/search_form_horiz.xul
Open-ILS/xul/staff_client/server/patron/search_result.xul
Open-ILS/xul/staff_client/server/patron/staged.js
Open-ILS/xul/staff_client/server/patron/staged.xul
Open-ILS/xul/staff_client/server/patron/standing_penalties.js
Open-ILS/xul/staff_client/server/patron/standing_penalties.xul
Open-ILS/xul/staff_client/server/patron/summary.js
Open-ILS/xul/staff_client/server/patron/summary.xul
Open-ILS/xul/staff_client/server/patron/summary_overlay.xul
Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul
Open-ILS/xul/staff_client/server/patron/user_buckets.xul
Open-ILS/xul/staff_client/server/patron/util.js
Open-ILS/xul/staff_client/server/serial/batch_receive.js
Open-ILS/xul/staff_client/server/serial/editor_base.js
Open-ILS/xul/staff_client/server/serial/manage_dists.js
Open-ILS/xul/staff_client/server/serial/manage_dists.xul
Open-ILS/xul/staff_client/server/serial/manage_items.js
Open-ILS/xul/staff_client/server/serial/manage_items.xul
Open-ILS/xul/staff_client/server/serial/manage_subs.js
Open-ILS/xul/staff_client/server/serial/manage_subs.xul
Open-ILS/xul/staff_client/server/serial/notes.xul
Open-ILS/xul/staff_client/server/serial/sbsum_editor.js
Open-ILS/xul/staff_client/server/serial/scap_editor.js
Open-ILS/xul/staff_client/server/serial/sdist_editor.js
Open-ILS/xul/staff_client/server/serial/select_aou.xul
Open-ILS/xul/staff_client/server/serial/select_unit.xul
Open-ILS/xul/staff_client/server/serial/serctrl_main.xul
Open-ILS/xul/staff_client/server/serial/siss_editor.js
Open-ILS/xul/staff_client/server/serial/sisum_editor.js
Open-ILS/xul/staff_client/server/serial/sitem_editor.js
Open-ILS/xul/staff_client/server/serial/sitem_editor.xul
Open-ILS/xul/staff_client/server/serial/sssum_editor.js
Open-ILS/xul/staff_client/server/serial/sstr_editor.js
Open-ILS/xul/staff_client/server/serial/ssub_editor.js
Open-ILS/xul/staff_client/server/skin/custom.js.example
Open-ILS/xul/staff_client/windowssetup.nsi
docs/RELEASE_NOTES_NEXT/new_xulrunner.txt [new file with mode: 0644]

index 64903e9..1f31081 100644 (file)
@@ -246,7 +246,8 @@ sub load_common {
     $ctx->{full_path} = $ctx->{base_path} . $self->cgi->path_info;
     $ctx->{unparsed_uri} = $self->apache->unparsed_uri;
     $ctx->{opac_root} = $ctx->{base_path} . "/opac"; # absolute base url
-    $ctx->{is_staff} = 0; # Assume false, check for workstation id later.  Was: ($self->apache->headers_in->get('User-Agent') =~ /oils_xulrunner/);
+    $ctx->{is_staff} = ($self->apache->headers_in->get('OILS-Wrapper') =~ /true/);
+    $ctx->{proto} = 'oils' if $ctx->{is_staff};
     $ctx->{physical_loc} = $self->get_physical_loc;
 
     # capture some commonly accessed pages
@@ -265,7 +266,6 @@ sub load_common {
                 'open-ils.actor', 
                 'open-ils.actor.user.opac.vital_stats', 
                 $e->authtoken, $e->requestor->id);
-            $ctx->{is_staff} = 1 if $e->requestor->wsid;
 
         } else {
 
index c3eddbf..c9a85af 100644 (file)
@@ -109,7 +109,8 @@ sub handler {
                                -cookie=>$cgi->cookie(
                                        -name=>'ses',
                                        -value=>$auth_ses,
-                                       -path=>'/'
+                                       -path=>'/',
+                                       -secure=>1
                                )
                        );
                        return Apache2::Const::REDIRECT;
index d6ca65e..5bf6c14 100644 (file)
@@ -74,7 +74,8 @@ sub handler {
                     $cookie = $cgi->cookie(
                         -name=>'ses',
                         -value=>$auth_ses,
-                        -path=>'/'
+                        -path=>'/',
+                        -secure=>1
                     );
                 }
             }
index 76c6b7a..2368055 100644 (file)
@@ -1,10 +1,6 @@
-[%- 
-    USE CGI = CGI_utf8;
-    hostname = CGI.url({'-base' => 1});
--%]
 <div id="footer-wrap">
 <div id="footer">
-    <a href="[% hostname %]">[% l('Dynamic catalog') %]</a> &nbsp;|&nbsp;
+    <a href="/">[% l('Dynamic catalog') %]</a> &nbsp;|&nbsp;
     <a href="http://example.com">[% l('Bottom Link 2') %]</a> &nbsp;|&nbsp;
     <a href="http://example.com">[% l('Bottom Link 3') %]</a> &nbsp;|&nbsp;
     <a href="http://example.com">[% l('Bottom Link 4') %]</a> &nbsp;|&nbsp;
index ba75412..e069b6e 100644 (file)
@@ -82,7 +82,7 @@
             END;
         ELSE;
             # staying on the current page
-            cgi.url("-path" => 1, "-query" => 1) _ final;
+            cgi.url("-absolute" => 1, "-path" => 1, "-query" => 1) _ final;
         END;
     END;
 
index 41cc5e8..501193e 100644 (file)
@@ -35,11 +35,16 @@ dojo.require('dijit.layout.LayoutContainer');
 dojo.require('dijit.layout.SplitContainer');
 dojo.require('dojox.widget.Toaster');
 dojo.require('dojox.fx');
+dojo.require('openils.XUL');
 dojo.requireLocalization("openils.conify", "conify");
 
 // some handy globals
 var cgi = new CGI();
 var ses = dojo.cookie('ses') || cgi.param('ses');
+if(!ses && openils.XUL.isXUL()) {
+    var stash = openils.XUL.getStash();
+    ses = stash.session.key;
+}
 var pcrud = new openils.PermaCrud({ authtoken : ses });
 
 var current_ou, current_ou_hoo, ou_list_store;
index 26cb07d..13170c0 100644 (file)
@@ -36,11 +36,16 @@ dojo.require('dijit.layout.LayoutContainer');
 dojo.require('dijit.layout.SplitContainer');
 dojo.require('dojox.widget.Toaster');
 dojo.require('dojox.fx');
+dojo.require('openils.XUL');
 dojo.requireLocalization("openils.conify", "conify");
 
 // some handy globals
 var cgi = new CGI();
 var ses = dojo.cookie('ses') || cgi.param('ses');
+if(!ses && openils.XUL.isXUL()) {
+    var stash = openils.XUL.getStash();
+    ses = stash.session.key;
+}
 var pCRUD = new openils.PermaCrud({authtoken:ses});
 
 var current_type;
index 1613ae8..fc0d883 100644 (file)
@@ -32,11 +32,16 @@ dojo.require('dijit.layout.BorderContainer');
 dojo.require('dojox.widget.Toaster');
 dojo.require('dojox.fx');
 dojo.require('dojox.grid.Grid');
+dojo.require('openils.XUL');
 dojo.requireLocalization("openils.conify", "conify");
 
 // some handy globals
 var cgi = new CGI();
 var ses = dojo.cookie('ses') || cgi.param('ses');
+if(!ses && openils.XUL.isXUL()) {
+    var stash = openils.XUL.getStash();
+    ses = stash.session.key;
+}
 var pCRUD = new openils.PermaCrud({authtoken:ses});
 
 var current_status;
index 4589a98..26fb16f 100644 (file)
@@ -34,6 +34,7 @@ dojo.require('dijit.layout.BorderContainer');
 dojo.require('dojox.widget.Toaster');
 dojo.require('dojox.fx');
 dojo.require('dojox.grid.Grid');
+dojo.require('openils.XUL');
 dojo.requireLocalization("openils.conify", "conify");
 
 console.log('loading marc_code_maps.js');
@@ -41,6 +42,10 @@ console.log('loading marc_code_maps.js');
 // some handy globals
 var cgi = new CGI();
 var ses = dojo.cookie('ses') || cgi.param('ses');
+if(!ses && openils.XUL.isXUL()) {
+    var stash = openils.XUL.getStash();
+    ses = stash.session.key;
+}
 var pCRUD = new openils.PermaCrud({authtoken:ses});
 
 console.log('initialized pcrud session');
index 1ee39d3..b4bacce 100644 (file)
@@ -40,11 +40,16 @@ dojo.require('dijit.layout.SplitContainer');
 dojo.require('dojox.widget.Toaster');
 dojo.require('dojox.fx');
 dojo.require('dojox.grid.Grid');
+dojo.require('openils.XUL');
 dojo.requireLocalization("openils.conify", "conify");
 
 // some handy globals
 var cgi = new CGI();
 var ses = dojo.cookie('ses') || cgi.param('ses');
+if(!ses && openils.XUL.isXUL()) {
+    var stash = openils.XUL.getStash();
+    ses = stash.session.key;
+}
 var server = {};
 server.pcrud = new openils.PermaCrud({ authtoken : ses });
 server.actor = new OpenSRF.ClientSession('open-ils.actor');
index ff303f9..9de5a90 100644 (file)
@@ -32,11 +32,16 @@ dojo.require('dijit.layout.BorderContainer');
 dojo.require('dojox.widget.Toaster');
 dojo.require('dojox.fx');
 dojo.require('dojox.grid.Grid');
+dojo.require('openils.XUL');
 dojo.requireLocalization("openils.conify", "conify");
 
 // some handy globals
 var cgi = new CGI();
 var ses = dojo.cookie('ses') || cgi.param('ses');
+if(!ses && openils.XUL.isXUL()) {
+    var stash = openils.XUL.getStash();
+    ses = stash.session.key;
+}
 var pCRUD = new openils.PermaCrud({authtoken : ses});
 
 var ppl_strings = dojo.i18n.getLocalization('openils.conify', 'conify');
index a7f4bfc..9385091 100644 (file)
@@ -5,7 +5,8 @@ if(!dojo._hasResource["openils.XUL"]) {
     dojo.declare('openils.XUL', null, {});
 
     openils.XUL.isXUL = function() {
-        return Boolean(dojo.cookie('xul')) || Boolean(window.IAMXUL);
+        if(location.protocol == 'chrome:' || location.protocol == 'oils:') return true;
+        return Boolean(window.IAMXUL);
     }
 
  try {
@@ -16,11 +17,8 @@ if(!dojo._hasResource["openils.XUL"]) {
     openils.XUL.getStash = function() {
         if(openils.XUL.isXUL()) {
             try {
-                if(openils.XUL.enableXPConnect()) {
-                    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-                    var CacheClass = new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
-                    return new CacheClass().wrappedJSObject.OpenILS.prototype.data;
-                }
+                var CacheClass = Components.classes["@open-ils.org/openils_data_cache;1"].getService();
+                return CacheClass.wrappedJSObject.data;
             } catch(e) {
                 console.log("Error loading XUL stash: " + e);
                 return { 'error' : e };
@@ -78,23 +76,6 @@ if(!dojo._hasResource["openils.XUL"]) {
         return xulG.get_new_session({callback : callback});
     }
 
-    /** 
-     * This can be used by privileged Firefox in addition to XUL.
-     * To use use in Firefox directly, set signed.applets.codebase_principal_support to true in about:config
-     */ 
-    openils.XUL.enableXPConnect = function() {
-        try {
-            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-        } catch (E) {
-            if(dojo.isFF) {
-                console.error("Unable to enable UniversalXPConnect privileges.  " +
-                    "Try setting 'signed.applets.codebase_principal_support' to true in about:config");
-            }
-            return false;
-        }
-        return true;
-    }
-
     /* This class cuts down on the obscenely long incantations needed to
      * use XPCOM components. */
     openils.XUL.SimpleXPCOM = function() {};
@@ -118,20 +99,12 @@ if(!dojo._hasResource["openils.XUL"]) {
         "create": function(key) {
             return Components.classes[this[key].cls].
                 createInstance(this[key].iface);
-        },
-        "getPrivilegeManager": function() {
-            return netscape.security.PrivilegeManager;
         }
     };
 
     openils.XUL.contentFromFileOpenDialog = function(windowTitle, sizeLimit) {
         var api = new openils.XUL.SimpleXPCOM();
 
-        /* The following enablePrivilege() call must happen at this exact
-         * level of scope -- not wrapped in another function -- otherwise
-         * it doesn't work. */
-        api.getPrivilegeManager().enablePrivilege("UniversalXPConnect");
-
         var picker = api.create("FP");
         picker.init(
             window, windowTitle || "Upload File", api.FP.iface.modeOpen
@@ -151,7 +124,6 @@ if(!dojo._hasResource["openils.XUL"]) {
 
     openils.XUL.contentToFileSaveDialog = function(content, windowTitle, dispositionArgs) {
         var api = new openils.XUL.SimpleXPCOM();
-        api.getPrivilegeManager().enablePrivilege("UniversalXPConnect");
 
         var picker = api.create("FP");
         picker.init(
index 5c0be1e..e301746 100644 (file)
@@ -31,6 +31,7 @@ if(!dojo._hasResource["openils.widget.TranslatorPopup"]) {
        dojo.require("dijit.form.TextBox");
        dojo.require("dijit.form.FilteringSelect");
        dojo.require("dojox.jsonPath");
+    dojo.require('openils.XUL');
        dojo.requireLocalization("openils.widget", "TranslatorPopup");
 
 
@@ -211,8 +212,13 @@ if(!dojo._hasResource["openils.widget.TranslatorPopup"]) {
                        
                                var _trans_dijit = this;
 
-                if (typeof(ses) == "undefined")
+                if (typeof(ses) == "undefined") {
                     var ses = cgi.param("ses") || dojo.cookie("ses");
+                    if(!ses && openils.XUL.isXUL()) {
+                        var stash = openils.XUL.getStash();
+                        ses = stash.session.key;
+                    }
+                }
 
                                OpenSRF.CachedClientSession('open-ils.permacrud').request({
                                        method : 'open-ils.permacrud.' + method + '.i18n',
index 4f5c3e7..8a6d7c9 100644 (file)
@@ -62,7 +62,7 @@ function oilsSetupUser() {
         }
     }
 
-    dojo.cookie('ses', authtoken, {path:'/'});
+    dojo.cookie('ses', authtoken, {path:'/', 'secure' : true});
     openils.User.authtoken = authtoken;
     openils.User.workstation = workstation;
     return authtoken;
index 6495c87..f9abb71 100644 (file)
@@ -1090,7 +1090,7 @@ function AcqLiTable() {
                     no_xulG : false, 
                     show_nav_buttons : true, 
                     show_print_button : true, 
-                    opac_url : xulG.url_prefix(xulG.urls.opac_rdetail + bib_id),
+                    opac_url : xulG.url_prefix('opac_rdetail|' + bib_id),
                     default_view : default_view
                 }
             );
@@ -2661,8 +2661,6 @@ function AcqLiTable() {
         /*  To run in Firefox directly, must set signed.applets.codebase_principal_support
             to true in about:config */
 
-        if(!openils.XUL.enableXPConnect()) return;
-
         if(openils.XUL.isXUL()) {
             win = window.open('/xul/' + openils.XUL.buildId() + '/server/cat/marcedit.xul');
         } else {
index dd0a735..eee5569 100644 (file)
@@ -1210,7 +1210,6 @@ function attachWidgetEvents(fmcls, fmfield, widget) {
         widget.widget,
         'onKeyPress',
         function(ev){
-            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
             if (!(ev.altKey || ev.ctrlKey || ev.metaKey)) {
                 if (lock_ready && xulG && typeof xulG.lock_tab == 'function') {
                     if (! already_locked) {
index 1d1e4c4..99fba63 100644 (file)
@@ -281,7 +281,6 @@ function loadMarcEditor(pcrud, rec) {
        To run in Firefox directly, must set signed.applets.codebase_principal_support
        to true in about:config
      */
-    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
     win = window.open('/xul/server/cat/marcedit.xul'); // XXX version?
 
     win.xulG = {
index d3e3d4b..2cfac2f 100644 (file)
@@ -157,7 +157,7 @@ function open_batch_receive() {
         return;
     }
 
-    var url = "/xul/server/serial/batch_receive.xul?docid=" +
+    var url = "XUL_SERIAL_BATCH_RECEIVE?docid=" +
         sub.record_entry() + "&subid=" + sub.id();
 
     try {
index 5382de9..a17c75f 100644 (file)
@@ -40,11 +40,8 @@ function SCAPRow() {
                 return;
             }
             try {
-                netscape.security.PrivilegeManager.enablePrivilege(
-                    "UniversalXPConnect"
-                );
                 window.openDialog(
-                    xulG.url_prefix("/xul/server/serial/pattern_wizard.xul"),
+                    xulG.url_prefix("XUL_SERIAL_PATTERN_WIZARD"),
                     "pattern_wizard",
                     "width=800",
                     function(value) {
index 2728b4c..e8b8f5a 100644 (file)
@@ -1520,7 +1520,6 @@ function vlOpenMarcEditWindow(rec, postReloadHTMLHandler) {
         To run in Firefox directly, must set signed.applets.codebase_principal_support
         to true in about:config
     */
-    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
     win = window.open('/xul/server/cat/marcedit.xul'); // XXX version?
 
     var type;
index ae43f11..bf65c78 100644 (file)
@@ -213,8 +213,7 @@ RemoteRequest.prototype.send = function(blocking) {
                        url = 'http://'+XML_HTTP_SERVER+'/'+XML_HTTP_GATEWAY;
 
                if( url.match(/^http:/) && 
-                               (this.secure || location.href.match(/^https:/) || location.href.match(/^chrome:/) ) ) {
-                       netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
+                               (this.secure || location.href.match(/^https:/) || location.href.match(/^chrome:/) || location.href.match(/^oils:/) ) ) {
                        url = url.replace(/^http:/, 'https:');
                }
        }
@@ -362,10 +361,8 @@ RemoteRequest.prototype.addParam = function(param) {
 function fetchXULStash() {
        if( isXUL() ) {
                try {
-                       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-                       var __OILS = new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
-                       var data_cache = new __OILS( );
-                       return data_cache.wrappedJSObject.OpenILS.prototype.data;
+                       var __OILS = Components.classes["@open-ils.org/openils_data_cache;1"].getService();
+                       return __OILS.wrappedJSObject.data;
        
                } catch(E) {
                        _debug('Error in OpenILS.data._debug_stash(): ' + js2JSON(E) );
index 78557b6..f3a2c43 100644 (file)
@@ -2,7 +2,10 @@
 
 
 /* define it again here for pages that don't load RemoteRequest */
-function isXUL() { try { if(IAMXUL) return true;}catch(e){return false;}; }
+function isXUL() {
+    if(location.protocol == 'chrome:' || location.protocol == 'oils:') return true;
+    try { if(IAMXUL) return true;}catch(e){return false;};
+}
 
 
 var __ilsEvent; /* the last event the occurred */
@@ -16,7 +19,7 @@ function Request(type) {
        var p = [];
 
        if(isXUL()) {
-               if(!location.href.match(/^https:/))
+               if(!location.href.match(/^https:/) && !location.href.match(/^oils:/))
                        this.request.setSecure(false);
 
        } else {
@@ -282,6 +285,7 @@ function findBasePath() {
 function findBaseURL(ssl) {
        var path = findBasePath();
        var proto = (ssl) ? "https:" : "http:";
+       if(ssl && location.protocol == 'oils:') proto = 'oils:';
 
        /* strip port numbers.  This is necessary for browsers that
        send an explicit  <host>:80, 443 - explicit ports
@@ -314,7 +318,6 @@ function _debug(str) {
        if(!IE) {
                if(!consoleService) {
                        try {
-                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                this.consoleService = Components.classes['@mozilla.org/consoleservice;1']
                                        .getService(Components.interfaces.nsIConsoleService);
                        } catch(e) {}
@@ -322,7 +325,6 @@ function _debug(str) {
        
                try {
                        if(consoleService) {
-                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                consoleService.logStringMessage(str + '\n');
                        }
                } catch(e){}
@@ -337,7 +339,7 @@ function  buildOPACLink(args, slim, ssl) {
        var string = "";
 
     if( ssl == undefined && (
-            location.protocol == 'https:' ||
+            location.protocol == 'https:' || location.protocol == 'oils:' ||
             (forceLoginSSL && G.user && G.user.session))) {
         ssl = true;
     }
@@ -521,7 +523,7 @@ function buildSearchLink(type, string, linknode, trunc) {
 }
 
 function setSessionCookie(ses) {
-       dojo.cookie(COOKIE_SES, ses);
+       dojo.cookie(COOKIE_SES, ses, {'secure':'true'});
 }
 
 
index c3fc671..690f01a 100644 (file)
         <script type="text/javascript" src="/js/dojo/dijit/dijit.js"></script>
         <script type="text/javascript" src="/js/dojo/openils/User.js"></script>
         <script type="text/javascript" src="/js/dojo/openils/Util.js"></script>
+        <script type="text/javascript" src="/js/dojo/openils/XUL.js"></script>
         <script type="text/javascript" src="/opac/extras/circ/alt_holds_print.js"></script>
         <script type="text/javascript">
             function my_init() {
                 cgi = new CGI();
                 authtoken = (typeof ses == "function" ? ses() : 0) ||
                     cgi.param("ses") || dojo.cookie("ses");
+                if(!authtoken && openils.XUL.isXUL()) {
+                    var stash = openils.XUL.getStash();
+                    authtoken = stash.session.key;
+                }
 
                 if (cgi.param("do") == "shelf_expired_holds") {
                     dojo.query("th[name=barcode_part]")[0].innerHTML = "Barcode";  /* XXX i18n. also, no support for part labels in this interface, at least for now */
index 55a1837..2a228f5 100644 (file)
@@ -337,7 +337,6 @@ function OpenMarcEditWindow(pcrud, rec) {
           To run in Firefox directly, must set signed.applets.codebase_principal_support
           to true in about:config
         */
-       netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
        win = window.open('/xul/server/cat/marcedit.xul'); // XXX version?
        dojo.require('openils.PermaCrud');
 
index ef6e7e2..67d6654 100644 (file)
@@ -25,8 +25,8 @@ function oilsInitReports() {
 
     dojo.require('dojo.cookie');
        oilsRptCurrentOrg = USER.ws_ou();
-       dojo.cookie(COOKIE_SES, SESSION, { 'path' : '/'});
-       dojo.cookie('ws_ou', USER.ws_ou(), { 'path' : '/'});
+       dojo.cookie(COOKIE_SES, SESSION, { 'path' : '/', 'secure' : true});
+       dojo.cookie('ws_ou', USER.ws_ou(), { 'path' : '/', 'secure' : true});
 
        oilsRptFetchOrgTree(
                function() {
index 7a9ca84..245657b 100644 (file)
@@ -1,4 +1,5 @@
 dojo.requireLocalization("openils.reports", "reports");
+dojo.require('openils.XUL');
 
 var rpt_strings = dojo.i18n.getLocalization("openils.reports", "reports");
 var idlNS      = "http://opensrf.org/spec/IDL/base/v1";
@@ -39,7 +40,10 @@ function sortLabels (a,b) {
 function loadTemplate(id) {
        var cgi = new CGI();
        var session = cgi.param('ses');
-
+    if(!session && openils.XUL.isXUL()) {
+        var stash = openils.XUL.getStash();
+        session = stash.session.key;
+    }
        var r = new Request('open-ils.reporter:open-ils.reporter.template.retrieve', session, id);
 
        r.callback(
index 46c66ac..ddc81e8 100644 (file)
@@ -43,8 +43,8 @@ function removeReportAtom (args) {
        return true;
 }
 
-function getSourceDefinition(class) {
-       var class_obj = getIDLClass(class);
+function getSourceDefinition(aClass) {
+       var class_obj = getIDLClass(aClass);
        return class_obj.getAttributeNS(persistNS,'tablename') || 
         '(' + class_obj.getElementsByTagNameNS(persistNS,'source_definition')[0].textContent + ')';
 }
index 40fffac..2a03b23 100644 (file)
 </commandset>
 
 <popupset>
-       <popup id="source-menu" position="after_start"/>
+       <menupopup id="source-menu" position="after_start"/>
        <popup
                id="calendar-widget"
                position="before_start"
index bcd8bd3..9aea32e 100644 (file)
@@ -9,10 +9,20 @@ export STAFF_CLIENT_STAMP_ID = $$(/bin/cat build/STAMP_ID)
 
 # from http://closure-compiler.googlecode.com/files/compiler-latest.zip  FIXME: Autotools this?
 export CLOSURE_COMPILER_JAR = ~/closure-compiler/compiler.jar
-XULRUNNER_VERSION=3.6.25
+
+# XULRunner is our base.
+XULRUNNER_VERSION=14.0.1
 XULRUNNER_WINFILE=xulrunner-$(XULRUNNER_VERSION).en-US.win32.zip
 XULRUNNER_LINUXFILE=xulrunner-$(XULRUNNER_VERSION).en-US.linux-i686.tar.bz2
 XULRUNNER_URL=ftp://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$(XULRUNNER_VERSION)/runtimes/
+XULRUNNER_MAJOR_VERSION=$$(echo ${XULRUNNER_VERSION} | cut -d. -f1)
+
+# Extensions we include when not an extension ourselves
+# Grab the latest. If that becomes a problem we can swap them out for specific versions.
+DOMINSPECTOR_URL=https://addons.mozilla.org/firefox/downloads/latest/6622/addon-6622-latest.xpi
+DOMINSPECTOR_ID=inspector@mozilla.org
+VENKMAN_URL=https://addons.mozilla.org/firefox/downloads/latest/216/addon-216-latest.xpi
+VENKMAN_ID={f13b157f-b174-47e7-a34d-4815ddfdfeb8}
 
 OPENSRF_JSLIBS = "$(OPENSRF_LIBS)/javascript"
 CHROME_LOCALES = $$(ls -1 chrome/locale)
@@ -83,6 +93,7 @@ build_dir:
        @cp -fR defaults build/
        @cp -fR components build/
        @cp application.ini build/
+       @cp chrome.manifest build/
        @if [ -f "install.mccoy.rdf" ]; then cp install.mccoy.rdf build/install.rdf; else cp install.rdf build/; fi
        @cp -fR build/chrome/content/util/ build/server/
        @cp -fR build/chrome/content/auth/ build/server/
@@ -142,6 +153,7 @@ stamp:
        @if [ -n "${STAFF_CLIENT_STAMP_ID}" ]; then find build/ -name '*.js' -exec sed -i -e s/xul\\\/server/xul\\\/${STAFF_CLIENT_STAMP_ID}\\\/server/g {} \; ; fi
        @if [ -n "${STAFF_CLIENT_STAMP_ID}" ]; then find build/ -name '*.xml' -exec sed -i -e s/xul\\\/server/xul\\\/${STAFF_CLIENT_STAMP_ID}\\\/server/g {} \; ; fi
        @if [ -n "${STAFF_CLIENT_STAMP_ID}" ]; then find build/ -name 'constants.js' -exec sed -i -e "s/\(CLIENT_STAMP *= '\)'/\1${STAFF_CLIENT_STAMP_ID}'/" {} \; ; fi
+       @if [ -n "${STAFF_CLIENT_NAME}" ]; then sed -i -e s/^Name=.\*/Name=${STAFF_CLIENT_NAME}/ build/application.ini ; fi
        @if [ -z "${AUTOUPDATE_HOST}" ]; then rm -f build/defaults/preferences/autoupdate.js; fi
        @if [ -z "${AUTOUPDATE_HOST}" ]; then sed -i -e /updateURL/d build/install.rdf; fi
        @if [ -n "${AUTOUPDATE_HOST}" ]; then echo "Applying automatic update host ${AUTOUPDATE_HOST}"; fi
@@ -221,10 +233,33 @@ client_dir:
 client_app: client_dir
        @echo 'Cleaning Extension Information'
        @rm -f client/install.rdf
+       @echo 'Installing Extensions'
+       @mkdir -p client/extensions
+# Note: XULRunner before 4 requires extracted extensions
+# XULRunner after 4 keeps them in XPI form...unless their manifest says to unpack
+# This block is thus structured to make it easy to add the latter kind later.
+       @if [ ${XULRUNNER_MAJOR_VERSION} -lt 4 ]; then \
+               if [ -f extensions/${DOMINSPECTOR_ID}.xpi ]; then \
+                       mkdir -p client/extensions/${DOMINSPECTOR_ID}/; \
+                       unzip extensions/${DOMINSPECTOR_ID}.xpi -d client/extensions/${DOMINSPECTOR_ID}/; \
+               fi; \
+               if [ -f extensions/${VENKMAN_ID}.xpi ]; then \
+                       mkdir -p client/extensions/${VENKMAN_ID}/; \
+                       unzip extensions/${VENKMAN_ID}.xpi -d client/extensions/${VENKMAN_ID}/; \
+               fi; \
+       else \
+               if [ -f extensions/${DOMINSPECTOR_ID}.xpi ]; then \
+                       cp extensions/${DOMINSPECTOR_ID}.xpi client/extensions/; \
+               fi; \
+               if [ -f extensions/${VENKMAN_ID}.xpi ]; then \
+                       cp extensions/${VENKMAN_ID}.xpi client/extensions/; \
+               fi; \
+       fi
 
 # If automatic updates are enabled, or the standalone_xul_app.js is present,
 # the extension can break Firefox.
-# Remove those, and we need a chrome.manifest
+# Also, per machine registration + extension mode is probably a bad idea.
+# Remove those, and we need an updated chrome.manifest
 
 client_ext: client_dir
        @echo 'Cleaning App Information'
@@ -232,8 +267,10 @@ client_ext: client_dir
        @rm -f client/defaults/preferences/autoupdate.js
        @rm -f client/defaults/preferences/autochannel.js
        @rm -f client/defaults/preferences/standalone_xul_app.js
+       @rm -f client/defaults/preferences/aa_per_machine.js
        @echo 'Prepping chrome.manifest'
        @perl -ne 'if(/open_ils_staff_client/) { s/ (?!chrome:\/\/open_ils_staff_client)([^ ]*)$$/ chrome\/\1/; print; }' client/chrome/chrome.manifest > client/chrome.manifest
+       @grep -v manifest build/chrome.manifest >> client/chrome.manifest
 
 # Would merge client_ext into this one, but this way an installer that doesn't
 # use an xpi can be made for extension later, if desired
@@ -243,6 +280,21 @@ extension: client_ext
        @(cd client/ && zip -q -r ../evergreen.xpi * -x defaults/preferences/standalone_xul_app.js)
        @md5sum evergreen.xpi > evergreen.xpi.md5
 
+# Fetch extensions to load into the client
+# This could be done in a "if they aren't there" fashion, but these are manually triggered anyway
+# That, and this way you can update the extensions by running this target again
+fetch-extensions: fetch-dom-inspector fetch-venkman
+
+fetch-dom-inspector:
+       @echo 'Fetching DOM Inspector'
+       @mkdir -p extensions/
+       @wget -Oextensions/${DOMINSPECTOR_ID}.xpi ${DOMINSPECTOR_URL}
+
+fetch-venkman:
+       @echo 'Fetching Venkman'
+       @mkdir -p extensions/
+       @wget -Oextensions/${VENKMAN_ID}.xpi ${VENKMAN_URL}
+
 # Generic client, as an xpi, theoretically suitable for --install-app usage
 
 generic-client: client_app
@@ -276,14 +328,18 @@ win-xulrunner: unzip_check branding_check client_app
        @if [ ! -f ${XULRUNNER_WINFILE} ]; then wget ${XULRUNNER_URL}${XULRUNNER_WINFILE}; fi
        @unzip -q ${XULRUNNER_WINFILE} -dclient
        @if [ -f client/defaults/preferences/autoupdate.js ]; then echo 'pref("app.update.channel","win");' >> client/defaults/preferences/autochannel.js; fi;
+       @if [ -d branding_win ]; then cp -fR branding_win/* client/; fi
        @echo 'Preparing stub'
        @if [ -f xulrunner-stub.exe ]; then cp xulrunner-stub.exe client/evergreen.exe; rm client/xulrunner/xulrunner-stub.exe; else mv client/xulrunner/xulrunner-stub.exe client/evergreen.exe; fi
+       @if [ ${XULRUNNER_MAJOR_VERSION} -ge 4 -a -f client/xulrunner/mozcrt19.dll ]; then cp client/xulrunner/mozcrt19.dll client/; fi # XULRunner 4+ need this, if the file exists
+       @if [ ${XULRUNNER_MAJOR_VERSION} -ge 9 -a -f client/xulrunner/mozutils.dll ]; then cp client/xulrunner/mozutils.dll client/; fi # XULRunner 9+ need this, if the file exists
 
 linux-xulrunner: client_app
        @echo 'Preparing Linux xulrunner'
        @if [ ! -f ${XULRUNNER_LINUXFILE} ]; then wget ${XULRUNNER_URL}${XULRUNNER_LINUXFILE}; fi
        @cd client; tar xjf ../${XULRUNNER_LINUXFILE}; cd ..
        @if [ -f client/defaults/preferences/autoupdate.js ]; then echo 'pref("app.update.channel","lin");' >> client/defaults/preferences/autochannel.js; fi;
+       @if [ -d branding_lin ]; then cp -fR branding_lin/* client/; fi
        @echo 'Preparing stub'
        @mv client/xulrunner/xulrunner-stub client/evergreen
 
index 66f9a22..bc089f6 100644 (file)
@@ -32,7 +32,7 @@ MinVersion=1.9
 ; application requires.  It should be specified if your application uses
 ; unfrozen interfaces.  Specifying 1.8 matches all releases with a version
 ; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2).
-MaxVersion=2.0
+MaxVersion=14.*
 
 [XRE]
 EnableExtensionManager=1
diff --git a/Open-ILS/xul/staff_client/chrome.manifest b/Open-ILS/xul/staff_client/chrome.manifest
new file mode 100644 (file)
index 0000000..bcb090c
--- /dev/null
@@ -0,0 +1,27 @@
+# Grab manifest from chrome directory
+manifest chrome/chrome.manifest
+# Grab xulrunner binary manifest
+manifest components/binary.manifest
+
+# Register our components
+#component {classID} components/file.js
+#contract @foobar/mycomponent;1 {classID}
+#category category-name MyComponent @foobar/mycomponent;1
+
+# Data Store Component
+component {dc3e4b5f-c0f4-4b34-bc57-7b4099c3a5d6} components/nsOpenILS.js
+contract @open-ils.org/openils_data_cache;1 {dc3e4b5f-c0f4-4b34-bc57-7b4099c3a5d6}
+
+# Command Line Handler
+component {7e608198-7355-483a-a85a-20322e4ef91a} components/clh.js
+contract @mozilla.org/commandlinehandler/general-startup;1?type=egcli {7e608198-7355-483a-a85a-20322e4ef91a}
+category command-line-handler m-egcli @mozilla.org/commandlinehandler/general-startup;1?type=egcli
+
+# Remote XUL Protocol (oils://)
+component {51d35450-5e59-11e1-b86c-0800200c9a66} components/oils_protocol.js
+contract @mozilla.org/network/protocol;1?name=oils {51d35450-5e59-11e1-b86c-0800200c9a66}
+
+# Force External
+component {D969ED61-DF4C-FA12-A2A6-70AA94C222FB} components/forceexternal.js
+contract @mozilla.org/content-policy;1?type=egfe {D969ED61-DF4C-FA12-A2A6-70AA94C222FB}
+category content-policy m-egfe @mozilla.org/content-policy;1?type=egfe
index dff9b63..0a4f723 100644 (file)
@@ -4,45 +4,3 @@ skin open_ils_staff_client open_ils_staff_client skin/
 locale branding en-US branding/locale/en-US/
 
 overlay chrome://browser/content/browser.xul chrome://open_ils_staff_client/content/firefox/overlay.xul
-
-style   chrome://global/content/customizeToolbar.xul    chrome://venkman/skin/venkman-overlay.css
-overlay chrome://messenger/content/messenger.xul        chrome://venkman/content/venkman-overlay.xul      application={3550f703-e582-4d05-9a08-453d09bdfdc6}
-overlay chrome://venkman/content/venkman-menus.xul      chrome://communicator/content/tasksOverlay.xul    application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-overlay chrome://communicator/content/tasksOverlay.xul  chrome://venkman/content/venkman-overlay.xul      application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-overlay chrome://calendar/content/calendar.xul          chrome://venkman/content/venkman-overlay.xul      application={718e30fb-e89b-41dd-9da7-e25a45638b28}
-overlay chrome://venkman/content/venkman.xul            chrome://communicator/content/utilityOverlay.xul  application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-content venkman-ff         jar:venkman.jar!/content/venkman/ff/
-content venkman            jar:venkman.jar!/content/venkman/
-content venkman            jar:venkman.jar!/content/venkman/ contentaccessible=yes
-skin    venkman modern/1.0 jar:venkman.jar!/skin/modern/venkman/
-content venkman-sm         jar:venkman.jar!/content/venkman/sm/
-overlay chrome://browser/content/browser.xul            chrome://venkman/content/venkman-overlay.xul      application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} application={a463f10c-3994-11da-9945-000d60ca027b}
-locale venkman en-US jar:venkman.jar!/locale/en-US/venkman/
-
-locale inspector de jar:inspector.jar!/locale/de/inspector/
-overlay chrome://inspector/content/inspector.xul chrome://communicator/content/utilityOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-locale inspector en-US jar:inspector.jar!/locale/en-US/inspector/
-overlay chrome://inspector/content/popupOverlay.xul chrome://inspector/content/viewers/dom/popupOverlay.xul
-overlay chrome://messenger/content/mailWindowOverlay.xul chrome://inspector/content/tasksOverlay-tb.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}
-overlay chrome://browser/content/macBrowserOverlay.xul chrome://inspector/content/tasksOverlay-ff.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-overlay chrome://communicator/content/tasksOverlay.xul chrome://inspector/content/tasksOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-overlay chrome://inspector/content/commandOverlay.xul chrome://inspector/content/viewers/styleRules/commandOverlay.xul
-overlay chrome://calendar/content/calendar.xul chrome://inspector/content/tasksOverlay-sb.xul application={718e30fb-e89b-41dd-9da7-e25a45638b28}
-overlay chrome://inspector/content/keysetOverlay.xul chrome://inspector/content/viewers/dom/keysetOverlay.xul
-skin inspector classic/1.0 jar:inspector.jar!/skin/classic/inspector/
-overlay chrome://browser/content/browser.xul chrome://inspector/content/tasksOverlay-ff.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-skin inspector modern/1.0 jar:inspector.jar!/skin/modern/inspector/
-locale inspector sk jar:inspector.jar!/locale/sk/inspector/
-overlay chrome://inspector/content/popupOverlay.xul chrome://inspector/content/viewers/styleRules/popupOverlay.xul
-overlay chrome://communicator/content/pref/preferences.xul chrome://inspector/content/prefs/prefsOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-content inspector jar:inspector.jar!/content/inspector/ xpcnativewrappers=no
-overlay chrome://inspector/content/commandOverlay.xul chrome://inspector/content/viewers/dom/commandOverlay.xul
-overlay chrome://inspector/content/inspector.xul chrome://browser/content/baseMenuOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-overlay chrome://inspector/content/inspector.xul chrome://communicator/content/tasksOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-
-content   chromelist                                jar:chrome_list.jar!/content/
-skin      chromelist       modern/1.0               jar:chrome_list.jar!/skin/
-locale    chromelist       en-US                    jar:chrome_list.jar!/locale/
-overlay   chrome://browser/content/browser.xul      chrome://chromelist/content/overlay/ChromeListOverlay.xul
-overlay   chrome://messenger/content/messenger.xul  chrome://chromelist/content/overlay/ChromeListOverlay.xul
-
diff --git a/Open-ILS/xul/staff_client/chrome/chrome_list.jar b/Open-ILS/xul/staff_client/chrome/chrome_list.jar
deleted file mode 100644 (file)
index 68deaa9..0000000
Binary files a/Open-ILS/xul/staff_client/chrome/chrome_list.jar and /dev/null differ
index f31ab3e..fc17229 100644 (file)
@@ -86,10 +86,8 @@ OpenILS.data.prototype = {
             obj.observers.add = function(full_path, func) {
                 try {
                     obj.error.sdump('D_OBSERVERS', 'entering observers.add\nfull_path = ' + full_path + '\nfunc = ' + func + '\n');
-                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-                    const OpenILS=new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
-                    var data_cache=new OpenILS( );
-                    var stash = data_cache.wrappedJSObject.OpenILS.prototype.data;
+                    var data_cache = Components.classes["@open-ils.org/openils_data_cache;1"].getService();
+                    var stash = data_cache.wrappedJSObject.data;
 
                     var id = obj.observers.id++;
                     if (typeof obj.observers.cache[ full_path ] == 'undefined') obj.observers.cache[ full_path ] = {};
@@ -162,14 +160,12 @@ OpenILS.data.prototype = {
 
     'stash' : function () {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-            const OpenILS=new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
-            var data_cache=new OpenILS( );
+            var data_cache = Components.classes["@open-ils.org/openils_data_cache;1"].getService();
             for (var i = 0; i < arguments.length; i++) {
                 try {
                     if (arguments[i] != 'hash' && arguments[i] != 'list') this.error.sdump('D_DATA_STASH','stashing ' + arguments[i] + ' : ' + this[arguments[i]] + (typeof this[arguments[i]] == 'object' ? ' = ' + (this[arguments[i]]) : '') + '\n');
                 } catch(F) { alert(F); }
-                data_cache.wrappedJSObject.OpenILS.prototype.data[arguments[i]] = this[arguments[i]];
+                data_cache.wrappedJSObject.data[arguments[i]] = this[arguments[i]];
             }
         } catch(E) {
             this.error.sdump('D_ERROR','Error in OpenILS.data.stash(): ' + js2JSON(E) );
@@ -216,10 +212,8 @@ OpenILS.data.prototype = {
 
     '_debug_stash' : function() {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-            const OpenILS=new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
-            var data_cache=new OpenILS( );
-            for (var i in data_cache.wrappedJSObject.OpenILS.prototype.data) {
+            var data_cache = Components.classes["@open-ils.org/openils_data_cache;1"].getService();
+            for (var i in data_cache.wrappedJSObject.data) {
                 dump('_debug_stash ' + i + '\n');
             }
         } catch(E) {
@@ -246,10 +240,8 @@ OpenILS.data.prototype = {
 
     'stash_retrieve' : function() {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-            const OpenILS=new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
-            var data_cache=new OpenILS( );
-            var dc = data_cache.wrappedJSObject.OpenILS.prototype.data;
+            var data_cache = Components.classes["@open-ils.org/openils_data_cache;1"].getService();
+            var dc = data_cache.wrappedJSObject.data;
             for (var i in dc) {
                 this.error.sdump('D_DATA_RETRIEVE','Retrieving ' + i + ' : ' + dc[i] + '\n');
                 this[i] = dc[i];
@@ -491,7 +483,6 @@ OpenILS.data.prototype = {
     },
 
     'network_retrieve' : function() {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var obj = this;
 
         JSAN.use('util.file'); var file = new util.file('global_font_adjust');
@@ -537,10 +528,8 @@ OpenILS.data.prototype = {
         function gen_fm_retrieval_func(classname,data) {
             var app = data[0]; var method = data[1]; var params = data[2]; var cacheable = data[3];
             return function () {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
                 function convert() {
-                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                     try {
                         if (obj.list[classname].constructor.name == 'Array') {
                             obj.hash[classname] = 
@@ -742,7 +731,6 @@ OpenILS.data.prototype = {
 
         this.chain.push(
             function() {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                 var f = gen_fm_retrieval_func(
                     'my_asv',
                     [
@@ -753,7 +741,6 @@ OpenILS.data.prototype = {
                     ]
                 );
                 try {
-                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                     f();
                 } catch(E) {
                     var error = 'Error: ' + js2JSON(E);
@@ -765,7 +752,6 @@ OpenILS.data.prototype = {
 
         this.chain.push(
             function() {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                 var f = gen_fm_retrieval_func(
                     'asv',
                     [
@@ -776,7 +762,6 @@ OpenILS.data.prototype = {
                     ]
                 );
                 try {
-                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                     f();
                 } catch(E) {
                     var error = 'Error: ' + js2JSON(E);
index 6a85fdd..38e62ae 100644 (file)
         }
     }
 
+    function oils_persist_hostname() {
+        if(location.protocol == 'oils:') {
+            JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
+            return data.server_unadorned;
+        } else {
+            return location.hostname;
+        }
+    }
+
     function persist_helper(base_key_suffix) {
         try {
             if (base_key_suffix) {
             function gen_oils_persist_handler(bk,node) {
                 return function(ev) {
                     try {
-                        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         var target;
                         if (ev.target.nodeName == 'command') {
                             target = node;
                             }
                         }
                         var filename = location.pathname.split('/')[ location.pathname.split('/').length - 1 ];
-                        var base_key = 'oils_persist_' + String(location.hostname + '_' + filename + '_' + target.getAttribute('id')).replace('/','_','g') + '_' + base_key_suffix;
+                        var base_key = 'oils_persist_' + String(oils_persist_hostname() + '_' + filename + '_' + target.getAttribute('id')).replace('/','_','g') + '_' + base_key_suffix;
                         var attribute_list = target.getAttribute('oils_persist').split(' ');
                         dump('on_oils_persist: <<< ' + target.nodeName + '.id = ' + target.id + '\t' + bk + '\n');
                         for (var j = 0; j < attribute_list.length; j++) {
                 };
             }
 
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
             var nodes = document.getElementsByAttribute('oils_persist','*');
             for (var i = 0; i < nodes.length; i++) {
                 var filename = location.pathname.split('/')[ location.pathname.split('/').length - 1 ];
-                var base_key = 'oils_persist_' + String(location.hostname + '_' + filename + '_' + nodes[i].getAttribute('id')).replace('/','_','g') + '_' + base_key_suffix;
+                var base_key = 'oils_persist_' + String(oils_persist_hostname() + '_' + filename + '_' + nodes[i].getAttribute('id')).replace('/','_','g') + '_' + base_key_suffix;
                 var attribute_list = nodes[i].getAttribute('oils_persist').split(' ');
                 dump('persist_helper: >>> ' + nodes[i].nodeName + '.id = ' + nodes[i].id + '\t' + base_key + '\n');
                 for (var j = 0; j < attribute_list.length; j++) {
 
     function get_contentWindow(frame) {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
             if (frame && frame.contentWindow) {
                 try {
                     if (typeof frame.contentWindow.wrappedJSObject != 'undefined') {
 
     function copy_to_clipboard(ev) {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
             var text;
             if (typeof ev == 'object') {
                 if (typeof ev.target != 'undefined') {
 
     function clear_the_cache() {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
             var cacheClass         = Components.classes["@mozilla.org/network/cache-service;1"];
             var cacheService    = cacheClass.getService(Components.interfaces.nsICacheService);
             cacheService.evictEntries(Components.interfaces.nsICache.STORE_ON_DISK);
     }
 
     function url_prefix(url) {
+        var base_url = url.match(/^[^?/|]+/);
+        if(base_url) {
+            base_url = base_url[0];
+            if(urls[base_url])
+                url = url.replace(/^[^?/|]+\|/, urls[base_url]);
+        }
         if (url.match(/^\//)) url = urls.remote + url;
-        if (! url.match(/^(http|chrome):\/\//) && ! url.match(/^data:/) ) url = 'http://' + url;
+        if (! url.match(/^(http|https|chrome|oils):\/\//) && ! url.match(/^data:/) ) url = 'http://' + url;
         dump('url_prefix = ' + url + '\n');
         return url;
     }
index c4b023b..c3b9e47 100644 (file)
                     dump('pulling in custom.js in util_overlay_chrome.xul\n');
                     // Pull in local customizations
                     var r = new XMLHttpRequest();
-                    r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false);
+                    var custom_js = xulG.url_prefix('CUSTOM_JS');
+                    r.open("GET", custom_js, false);
                     r.send(null);
                     if (r.status == 200) {
-                        dump('Evaluating /xul/server/skin/custom.js\n');
+                        dump('Evaluating ' + custom_js + '\n');
                         eval( r.responseText );
                     }
                 } else {
index 5b50799..2b834db 100644 (file)
                     dump('pulling in custom.js in util_overlay_offline.xul\n');
                     // Pull in local customizations
                     var r = new XMLHttpRequest();
-                    r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false);
+                    var custom_js = xulG.url_prefix('CUSTOM_JS');
+                    r.open("GET", custom_js, false);
                     r.send(null);
                     if (r.status == 200) {
-                        dump('Evaluating /xul/server/skin/custom.js\n');
+                        dump('Evaluating ' + custom_js + '\n');
                         eval( r.responseText );
                     }
                 } else {
index 95aacf8..6fe3dba 100644 (file)
@@ -26,7 +26,6 @@
     <![CDATA[
         function my_init() {
             try {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                 if (typeof JSAN == 'undefined') { throw( document.getElementById("offlineStrings").getString('common.jsan.missing') ); }
                 JSAN.errorLevel = "die"; // none, warn, or die
                 JSAN.addRepository('..');
index dd6de40..071fc66 100644 (file)
@@ -196,7 +196,6 @@ auth.controller.prototype = {
                                             ws.name /*+ ' @  ' + ws.lib_shortname*/
                                         )
                                     );
-                                    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
                                     JSAN.use('util.file'); var file = new util.file('last_ws_server');
                                     file.set_object(obj.controller.view.server_prompt.value);
                                     file.close();
@@ -284,7 +283,6 @@ auth.controller.prototype = {
     'test_server' : function(url) {
         var obj = this;
         if (!url) {
-            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
             JSAN.use('util.file'); var file = new util.file('last_ws_server');
             if (file._file.exists()) {
                 url = file.get_object(); file.close();
@@ -554,9 +552,11 @@ auth.controller.prototype = {
         this.data.menu_perms = false;
         this.data.current_hotkeyset = undefined;
         this.data.enable_debug = this.data.debug_client;
+        this.data.session = undefined;
         this.data.stash('menu_perms');
         this.data.stash('current_hotkeyset');
         this.data.stash('enable_debug');
+        this.data.stash('session');
 
         /* FIXME - need some locking or object destruction for the async tests */
         /* this.test_server( this.controller.view.server_prompt.value ); */
index 31843ee..880b4eb 100644 (file)
@@ -158,9 +158,22 @@ auth.session.prototype = {
         var obj = this;
         obj.error.sdump('D_AUTH','auth.session.close()\n'); 
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-            Components.classes["@mozilla.org/cookiemanager;1"]
-                .getService(Components.interfaces.nsICookieManager).removeAll();
+            // Remove *our* cookie(s), but leave any from elsewhere alone.
+            JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
+            var host = data.server_unadorned;
+            host = host.toLowerCase();
+            var cookieManager = Components.classes["@mozilla.org/cookiemanager;1"]
+                .getService(Components.interfaces.nsICookieManager);
+            var iter = cookieManager.enumerator;
+            while (iter.hasMoreElements()) {
+                var cookie = iter.getNext();
+                if (cookie instanceof Components.interfaces.nsICookie) {
+                    var temphost = cookie.host.toLowerCase();
+                    if(temphost == host || temphost == '.' + host) {
+                        cookieManager.remove(cookie.host, cookie.name, cookie.path, cookie.blocked);
+                    }
+                }
+            }
         } catch(E) {
             dump('Error in auth/session.js, close(): ' + E + '\n');
         }
index a2ce364..9f58b81 100644 (file)
@@ -12,7 +12,6 @@ function $(id) { return document.getElementById(id); }
 
 function my_init() {
     try {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         if (typeof JSAN == 'undefined') { throw(document.getElementById('offlineStrings').getString('common.jsan.missing')); }
         JSAN.errorLevel = "die"; // none, warn, or die
         JSAN.addRepository('..');
@@ -24,10 +23,11 @@ function my_init() {
 
         // Pull in local customizations
         var r = new XMLHttpRequest();
-        r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false);
+        var custom_js = xulG.url_prefix('CUSTOM_JS');
+        r.open("GET", custom_js, false);
         r.send(null);
         if (r.status == 200) {
-            dump('Evaluating /xul/server/skin/custom.js\n');
+            dump('Evaluating ' + custom_js + '\n');
             eval( r.responseText );
         }
 
@@ -89,7 +89,7 @@ function opac_wrapper_set_help_context() {
 }
 
 function set_brief_view() {
-    var url = xulG.url_prefix( urls.XUL_BIB_BRIEF ) + '?docid=' + window.escape(docid); 
+    var url = xulG.url_prefix( 'XUL_BIB_BRIEF?docid=' ) + window.escape(docid); 
     dump('spawning ' + url + '\n');
 
     var content_params = {
@@ -119,10 +119,10 @@ function set_brief_view() {
 function set_marc_view() {
     g.view = 'marc_view';
     if (marc_view_reset) {
-        bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_MARC_VIEW ) + '?docid=' + window.escape(docid),{},xulG);
+        bottom_pane.reset_iframe( xulG.url_prefix( 'XUL_MARC_VIEW?docid=' ) + window.escape(docid),{},xulG);
         marc_view_reset = false;
     } else {
-        bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_MARC_VIEW ) + '?docid=' + window.escape(docid),{},xulG);
+        bottom_pane.set_iframe( xulG.url_prefix( 'XUL_MARC_VIEW?docid=' ) + window.escape(docid),{},xulG);
     }
     opac_wrapper_set_help_context(); 
     bottom_pane.get_contentWindow().addEventListener('load',opac_wrapper_set_help_context,false);
@@ -130,7 +130,7 @@ function set_marc_view() {
 
 function set_marc_edit() {
     g.view = 'marc_edit';
-    var a =    xulG.url_prefix( urls.XUL_MARC_EDIT );
+    var a =    xulG.url_prefix( 'XUL_MARC_EDIT' );
     var b =    {};
     var c =    {
             'marc_control_number_identifier' : g.data.hash.aous['cat.marc_control_number_identifier'] || 'Set cat.marc_control_number_identifier in Library Settings',
@@ -222,7 +222,7 @@ function set_marc_edit() {
                             var unified_interface = String( data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true';
                             if (unified_interface) {
                                 var horizontal_interface = String( data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true';
-                                var url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR );
+                                var url = window.xulG.url_prefix( horizontal_interface ? 'XUL_VOLUME_COPY_CREATOR_HORIZONTAL' : 'XUL_VOLUME_COPY_CREATOR' );
                                 var w = xulG.set_tab(
                                     url,
                                     {
@@ -292,10 +292,10 @@ function set_marc_edit() {
 function set_copy_browser() {
     g.view = 'copy_browser';
     if (copy_browser_reset) {
-        bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_COPY_VOLUME_BROWSE ) + '?docid=' + window.escape(docid),{},xulG);
+        bottom_pane.reset_iframe( xulG.url_prefix( 'XUL_COPY_VOLUME_BROWSE?docid=' ) + window.escape(docid),{},xulG);
         copy_browser_reset =false;
     } else {
-        bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_COPY_VOLUME_BROWSE ) + '?docid=' + window.escape(docid),{},xulG);
+        bottom_pane.set_iframe( xulG.url_prefix( 'XUL_COPY_VOLUME_BROWSE?docid=' ) + window.escape(docid),{},xulG);
     }
     opac_wrapper_set_help_context(); 
     bottom_pane.get_contentWindow().addEventListener('load',opac_wrapper_set_help_context,false);
@@ -304,10 +304,10 @@ function set_copy_browser() {
 function set_hold_browser() {
     g.view = 'hold_browser';
     if (hold_browser_reset) {
-        bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_HOLDS_BROWSER ) + '?docid=' + window.escape(docid),{},xulG);
+        bottom_pane.reset_iframe( xulG.url_prefix( 'XUL_HOLDS_BROWSER?docid=' ) + window.escape(docid),{},xulG);
         hold_browser_reset = false;
     } else {
-        bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_HOLDS_BROWSER ) + '?docid=' + window.escape(docid),{},xulG);
+        bottom_pane.set_iframe( xulG.url_prefix( 'XUL_HOLDS_BROWSER?docid=' ) + window.escape(docid),{},xulG);
     }
     opac_wrapper_set_help_context(); 
     bottom_pane.get_contentWindow().addEventListener('load',opac_wrapper_set_help_context,false);
@@ -333,7 +333,7 @@ function open_acq_orders() {
         ].forEach(function(k) { content_params[k] = xulG[k]; });
 
         var loc = urls.XUL_BROWSER + "?url=" + window.escape(
-            xulG.url_prefix("/eg/acq/lineitem/related/") +
+            xulG.url_prefix("ACQ_LINEITEM") +
             docid + "?target=bib"
         );
         xulG.new_tab(
@@ -371,7 +371,7 @@ function open_alt_serial_mgmt() {
         ].forEach(function(k) { content_params[k] = xulG[k]; });
 
         var loc = urls.XUL_BROWSER + "?url=" + window.escape(
-            xulG.url_prefix("/eg/serial/list_subscription?record_entry=") +
+            xulG.url_prefix("SERIAL_LIST_SUBSCRIPTION?record_entry=") +
             docid
         );
         xulG.new_tab(
@@ -398,7 +398,6 @@ function set_opac() {
                 'authtime' : ses('authtime'),
                 'window_open' : function(a,b,c) {
                     try {
-                        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
                         return window.open(a,b,c);
                     } catch(E) {
                         g.error.standard_unexpected_error_alert('window_open',E);
@@ -441,7 +440,6 @@ function set_opac() {
                 }
             },
             'on_url_load' : function(f) {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                 var win;
                 try {
                     if (typeof f.contentWindow.wrappedJSObject.attachEvt != 'undefined') {
@@ -607,7 +605,6 @@ function set_opac() {
         content_params.get_barcode_and_settings = xulG.get_barcode_and_settings;
 
         var secure_opac = true; // default to secure
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
         if (prefs.prefHasUserValue('oils.secure_opac')) {
             secure_opac = prefs.getBoolPref('oils.secure_opac');
@@ -617,11 +614,11 @@ function set_opac() {
         if (opac_url) {
             content_params.url = xulG.url_prefix( opac_url, secure_opac );
         } else {
-            content_params.url = xulG.url_prefix( urls.browser, secure_opac );
+            content_params.url = xulG.url_prefix( 'browser', secure_opac );
         }
-        browser_frame = bottom_pane.set_iframe( xulG.url_prefix(urls.XUL_BROWSER) + '?name=Catalog', {}, content_params);
+        browser_frame = bottom_pane.set_iframe( xulG.url_prefix('XUL_BROWSER?name=Catalog'), {}, content_params);
         /* // Remember to use the REMOTE_BROWSER if we ever try to move this to remote xul again
-        browser_frame = bottom_pane.set_iframe( xulG.url_prefix(urls.XUL_REMOTE_BROWSER) + '?name=Catalog', {}, content_params);
+        browser_frame = bottom_pane.set_iframe( xulG.url_prefix('XUL_REMOTE_BROWSER?name=Catalog'), {}, content_params);
         */
     } catch(E) {
         g.error.sdump('D_ERROR','set_opac: ' + E);
@@ -643,10 +640,10 @@ xulG.reload_opac = function() {
 function set_serctrl_view() {
     g.view = 'serctrl_view';
     if (serctrl_view_reset) {
-        bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_SERIAL_SERCTRL_MAIN ) + '?docid=' + window.escape(docid), {}, xulG);
+        bottom_pane.reset_iframe( xulG.url_prefix( 'XUL_SERIAL_SERCTRL_MAIN?docid=' ) + window.escape(docid), {}, xulG);
         serctrl_view_reset =false;
     } else {
-        bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_SERIAL_SERCTRL_MAIN ) + '?docid=' + window.escape(docid), {}, xulG);
+        bottom_pane.set_iframe( xulG.url_prefix( 'XUL_SERIAL_SERCTRL_MAIN?docid=' ) + window.escape(docid), {}, xulG);
     }
 }
 
@@ -680,7 +677,7 @@ function create_mfhd() {
     try {
         JSAN.use('util.window'); var win = new util.window();
         var select_aou_window = win.open(
-            xulG.url_prefix(urls.XUL_SERIAL_SELECT_AOU),
+            xulG.url_prefix('XUL_SERIAL_SELECT_AOU'),
             '_blank',
             'chrome,resizable,modal,centerscreen',
             {'server_unadorned' : g.data.server_unadorned}
@@ -739,7 +736,7 @@ function open_mfhd_editor(sre_id) {
 }
 
 function open_marc_editor(rec, label) {
-    win = window.open( xulG.url_prefix('/xul/server/cat/marcedit.xul') );
+    win = window.open( xulG.url_prefix('XUL_MARC_EDIT') );
 
     win.xulG = {
         record : {marc : rec.marc()},
@@ -785,7 +782,7 @@ function bib_in_new_tab() {
         content_params.get_barcode = xulG.get_barcode;
         content_params.get_barcode_and_settings = xulG.get_barcode_and_settings;
 
-        xulG.new_tab(xulG.url_prefix(urls.XUL_OPAC_WRAPPER), {}, content_params);
+        xulG.new_tab(xulG.url_prefix('XUL_OPAC_WRAPPER'), {}, content_params);
     } catch(E) {
         g.error.sdump('D_ERROR',E);
     }
@@ -804,8 +801,8 @@ function batch_receive_in_new_tab() {
         ].forEach(function(k) { content_params[k] = xulG[k]; });
 
         xulG.new_tab(
-            xulG.url_prefix(urls.XUL_SERIAL_BATCH_RECEIVE) +
-                "?docid=" + window.escape(docid), {
+            xulG.url_prefix('XUL_SERIAL_BATCH_RECEIVE?docid=') +
+                window.escape(docid), {
                 "tab_name": $("offlineStrings").getString(
                     "menu.cmd_serial_batch_receive.tab"
                 )
@@ -817,7 +814,7 @@ function batch_receive_in_new_tab() {
 }
 
 function remove_me() {
-    var url = xulG.url_prefix( urls.XUL_BIB_BRIEF ) + '?docid=' + window.escape(docid);
+    var url = xulG.url_prefix( 'XUL_BIB_BRIEF?docid=' ) + window.escape(docid);
     dump('removing ' + url + '\n');
     try { top_pane.remove_iframe( url ); } catch(E) { dump(E + '\n'); }
     $('nav').setAttribute('hidden','true');
@@ -826,7 +823,7 @@ function remove_me() {
 function add_to_bucket() {
     JSAN.use('util.window'); var win = new util.window();
     win.open(
-        xulG.url_prefix(urls.XUL_RECORD_BUCKETS_QUICK),
+        xulG.url_prefix('XUL_RECORD_BUCKETS_QUICK'),
         '_blank',
         'chrome,resizable,modal,centerscreen',
         {
@@ -1062,9 +1059,9 @@ function add_volumes() {
         var unified_interface = String( g.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true';
         if (unified_interface) {
             var horizontal_interface = String( g.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true';
-            url = window.xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR );
+            url = window.xulG.url_prefix( horizontal_interface ? 'XUL_VOLUME_COPY_CREATOR_HORIZONTAL' : 'XUL_VOLUME_COPY_CREATOR' );
         } else {
-            url = window.xulG.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL );
+            url = window.xulG.url_prefix( 'XUL_VOLUME_COPY_CREATOR_ORIGINAL' );
         }
 
         var w = xulG.new_tab(
@@ -1081,7 +1078,7 @@ function manage_parts() {
     try {
         g.view = 'manage_parts';
         var loc = urls.XUL_BROWSER + "?url=" + window.escape(
-            window.xulG.url_prefix(urls.CONIFY_MANAGE_PARTS) + '?r=' + docid
+            window.xulG.url_prefix('CONIFY_MANAGE_PARTS?r=') + docid
         );
         if (manage_parts_reset) {
             bottom_pane.reset_iframe( loc,{},xulG);
@@ -1099,7 +1096,7 @@ function manage_parts() {
 function manage_multi_home_items() {
     try {
         g.view = 'manage_multi_home';
-        var loc = window.xulG.url_prefix(urls.MANAGE_MULTI_HOME_ITEMS);
+        var loc = window.xulG.url_prefix('MANAGE_MULTI_HOME_ITEMS');
         if (manage_multi_home_reset) {
             bottom_pane.reset_iframe( loc,{},{'docid':docid,'no_bib_summary':true,'url_prefix':xulG.url_prefix,'new_tab':xulG.new_tab});
             manage_multi_home_reset =false;
@@ -1152,14 +1149,14 @@ function gen_statusbar_click_handler(data_key) {
         }
 
         if (ev.button == 0 /* left click, spawn opac */) {
-            var opac_url = xulG.url_prefix( urls.opac_rdetail ) + g.data[data_key];
+            var opac_url = xulG.url_prefix( 'opac_rdetail' ) + g.data[data_key];
             var content_params = {
                 'session' : ses(),
                 'authtime' : ses('authtime'),
                 'opac_url' : opac_url,
             };
             xulG.new_tab(
-                xulG.url_prefix(urls.XUL_OPAC_WRAPPER),
+                xulG.url_prefix('XUL_OPAC_WRAPPER'),
                 {'tab_name':'Retrieving title...'},
                 content_params
             );
index 0c97436..ab15bc3 100644 (file)
@@ -23,7 +23,6 @@
     <!-- BEHAVIOR -->
         <script type="text/javascript">
         var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     </script>
         <scripts id="openils_util_scripts"/>
 <script type="text/javascript" src="chrome://openils_staff_client/content/OpenILS/util/fmall.js"/>
index d3cc499..225fadf 100644 (file)
@@ -3,7 +3,6 @@ dump('entering circ.offline.js\n');
 if (typeof circ == 'undefined') circ = {};
 circ.offline = function (params) {
     try {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         JSAN.use('util.error'); this.error = new util.error();
     } catch(E) {
         dump('circ.offline: ' + E + '\n');
@@ -15,8 +14,6 @@ circ.offline.prototype = {
     'init' : function( params ) {
 
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
             var obj = this;
 
             JSAN.use('util.deck'); obj.deck = new util.deck('main');
index 4b94d7a..dbd9111 100644 (file)
@@ -37,7 +37,6 @@
             try {
                 offlineStrings = document.getElementById('offlineStrings');
 
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         if (typeof JSAN == 'undefined') { throw(offlineStrings.getString('common.jsan.missing')); }
                 JSAN.errorLevel = "die"; // none, warn, or die
                 JSAN.addRepository('..');
index e764878..31e5bbe 100644 (file)
@@ -5,7 +5,6 @@ function my_init() {
     try {
         offlineStrings = $('offlineStrings');
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         if (typeof JSAN == 'undefined') { throw(offlineStrings.getString('common.jsan.missing')); }
         JSAN.errorLevel = "die"; // none, warn, or die
         JSAN.addRepository('..');
@@ -28,7 +27,6 @@ function my_init() {
         JSAN.use('util.date');
 
         function handle_lock(ev) {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             if (!(ev.altKey || ev.ctrlKey || ev.metakey)) {
                 if (!local_lock) {
                     local_lock = true;
index 99da750..3190b3a 100644 (file)
@@ -5,7 +5,6 @@ function my_init() {
     try {
         offlineStrings = $('offlineStrings');
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         if (typeof JSAN == 'undefined') { throw(offlineStrings.getString('common.jsan.missing')); }
         JSAN.errorLevel = "die"; // none, warn, or die
         JSAN.addRepository('..');
@@ -33,7 +32,6 @@ function my_init() {
         todayPlus = util.date.formatted_date(todayPlus,"%F");
 
         function handle_lock(ev) {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             if (!(ev.altKey || ev.ctrlKey || ev.metakey)) {
                 if (!local_lock) {
                     local_lock = true;
index f849b4e..4004fd9 100644 (file)
@@ -5,7 +5,6 @@ function my_init() {
     try {
         offlineStrings = document.getElementById('offlineStrings');
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         if (typeof JSAN == 'undefined') { throw(offlineStrings.getString('common.jsan.missing')); }
         JSAN.errorLevel = "die"; // none, warn, or die
         JSAN.addRepository('..');
@@ -26,7 +25,6 @@ function my_init() {
         } );
 
         function handle_lock(ev) {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             if (!(ev.altKey || ev.ctrlKey || ev.metakey)) {
                 if (!local_lock) {
                     local_lock = true;
index f3e31c1..fe16aef 100644 (file)
@@ -5,7 +5,6 @@ function my_init() {
     try {
         offlineStrings = $('offlineStrings');
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         if (typeof JSAN == 'undefined') { throw(offlineStrings.getString('common.jsan.missing')); }
         JSAN.errorLevel = "die"; // none, warn, or die
         JSAN.addRepository('..');
@@ -23,7 +22,6 @@ function my_init() {
         $('submit').addEventListener('command',next_patron,false);
 
         function handle_lock(ev) {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             if (!(ev.altKey || ev.ctrlKey || ev.metakey)) {
                 if (!local_lock) {
                     local_lock = true;
index d04cc5a..780b3b1 100644 (file)
@@ -4,7 +4,6 @@ var local_lock = false;
 function my_init() {
     try {
         offlineStrings = $('offlineStrings');
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
         JSAN.errorLevel = "die"; // none, warn, or die
         JSAN.addRepository('..');
@@ -30,7 +29,6 @@ function my_init() {
         todayPlus = util.date.formatted_date(todayPlus,"%F");
 
         function handle_lock(ev) {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             if (!(ev.altKey || ev.ctrlKey || ev.metakey)) {
                 if (!local_lock) {
                     local_lock = true;
index cbe6988..544e6ba 100644 (file)
@@ -1,19 +1,18 @@
 <?xml version="1.0"?>
-<overlay id="sample
+<overlay id="eg_firefox_browser
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<!--
- <statusbar id="status-bar">
-  <statusbarpanel id="my-panel" label="Hello, World"  />
- </statusbar>
--->
   <menupopup id="menu_ToolsPopup">
-    <menuitem id="evergreen_entry" insertbefore="devToolsSeparator" label="Evergreen Client"
-        oncommand="try {
-          Components.classes['@mozilla.org/embedcomp/window-watcher;1']
-                    .getService(Components.interfaces.nsIWindowWatcher)
-                    .openWindow(null, 'chrome://open_ils_staff_client/content/main/main.xul', '_blank',
-                                'chrome,dialog=no,all', null);
-            } catch(E) { alert(E); }
-        "/>
+    <menuitem id="evergreen_entry_tools" insertbefore="devToolsSeparator" label="Evergreen Client"
+      oncommand="try {
+          Components.classes['@open-ils.org/openils_data_cache;1'].getService().wrappedJSObject.openMainEGWindow();
+        } catch(E) { alert(E); }
+      "/>
   </menupopup>
+  <vbox id="appmenuPrimaryPane">
+    <menuitem id="evergreen_entry_primary" insertafter="appmenu_webDeveloper" label="Evergreen Client"
+      oncommand="try {
+          Components.classes['@open-ils.org/openils_data_cache;1'].getService().wrappedJSObject.openMainEGWindow();
+        } catch(E) { alert(E); }
+      "/>
+  </vbox>
 </overlay>
index 870f430..70041d6 100644 (file)
@@ -4,16 +4,15 @@ dump('Loading constants.js\n');
 
     urls['AUDIO_good'] = '/xul/server/skin/media/custom/good.wav';
 
-    urls['opac'] = '/opac/' + LOCALE + '/skin/mylib/xml/advanced.xml?nps=1';
-    urls['opac_rdetail'] = '/opac/' + LOCALE + '/skin/mylib/xml/rdetail.xml';
-    urls['opac_rresult'] = '/opac/' + LOCALE + '/skin/mylib/xml/rresult.xml';
-    urls['browser'] = '/opac/' + LOCALE + '/skin/mylib/xml/advanced.xml?nps=1';
+    urls['opac'] = 'oils://remote/opac/' + LOCALE + '/skin/mylib/xml/advanced.xml?nps=1';
+    urls['opac_rdetail'] = 'oils://remote/opac/' + LOCALE + '/skin/mylib/xml/rdetail.xml';
+    urls['opac_rresult'] = 'oils://remote/opac/' + LOCALE + '/skin/mylib/xml/rresult.xml';
+    urls['browser'] = 'oils://remote/opac/' + LOCALE + '/skin/mylib/xml/advanced.xml?nps=1';
 
 */
 
 /* Get locale from preferences */
 var LOCALE = '';
-netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
 try {
     LOCALE = pref.getCharPref('general.useragent.locale');
@@ -380,17 +379,17 @@ var api = {
 
 var urls = {
 
-    'opac' : '/opac/' + LOCALE + '/skin/default/xml/advanced.xml?nps=1',
-    'opac_rdetail' : '/opac/' + LOCALE + '/skin/default/xml/rdetail.xml?r=',
-    'opac_rresult' : '/opac/' + LOCALE + '/skin/default/xml/rresult.xml',
-    'opac_rresult_metarecord' : '/opac/' + LOCALE + '/skin/default/xml/rresult.xml?m=',
+    'opac' : 'oils://remote/opac/' + LOCALE + '/skin/default/xml/advanced.xml?nps=1',
+    'opac_rdetail' : 'oils://remote/opac/' + LOCALE + '/skin/default/xml/rdetail.xml?r=',
+    'opac_rresult' : 'oils://remote/opac/' + LOCALE + '/skin/default/xml/rresult.xml',
+    'opac_rresult_metarecord' : 'oils://remote/opac/' + LOCALE + '/skin/default/xml/rresult.xml?m=',
     'org_tree' : '/opac/common/js/' + LOCALE + '/OrgTree.js',
-    'browser' : '/opac/' + LOCALE + '/skin/default/xml/advanced.xml?nps=1',
+    'browser' : 'oils://remote/opac/' + LOCALE + '/skin/default/xml/advanced.xml?nps=1',
     'fieldmapper' : '/opac/common/js/fmall.js',
     'xsl_marc2html' : '/opac/extras/xsl/oilsMARC21slim2HTML.xsl',
     'ac_jacket_small' : '/opac/extras/ac/jacket/small/',
     'ac_jacket_large' : '/opac/extras/ac/jacket/large/',
-    'MARC_BATCH_EDIT' : '/opac/extras/merge_template/',
+    'MARC_BATCH_EDIT' : 'oils://remote/opac/extras/merge_template/',
 
     'AUDIO_good' : '/xul/server/skin/media/audio/bonus.wav',
     'AUDIO_bad' : '/xul/server/skin/media/audio/question.wav',
@@ -400,126 +399,137 @@ var urls = {
     'AUDIO_event_ASSET_COPY_NOT_FOUND' : '/xul/server/skin/media/audio/redalert.wav',
 
     'AUTHORITY_MANAGE' : '/eg/cat/authority/list',
-    'MANAGE_MULTI_HOME_ITEMS' : '/xul/server/cat/manage_multi_home_items.xul',
-    'XUL_AUTH_SIMPLE' : '/xul/server/main/simple_auth.xul',
-    'XUL_BIB_BRIEF' : '/xul/server/cat/bib_brief.xul',
-    'XUL_BIB_BRIEF_VERTICAL' : '/xul/server/cat/bib_brief_vertical.xul',
+    'MANAGE_MULTI_HOME_ITEMS' : 'oils://remote/xul/server/cat/manage_multi_home_items.xul',
+    'XUL_AUTH_SIMPLE' : 'oils://remote/xul/server/main/simple_auth.xul',
+    'XUL_BIB_BRIEF' : 'oils://remote/xul/server/cat/bib_brief.xul',
+    'XUL_BIB_BRIEF_VERTICAL' : 'oils://remote/xul/server/cat/bib_brief_vertical.xul',
     'XUL_BROWSER' : 'chrome://open_ils_staff_client/content/util/browser.xul',
-    'XUL_CHECKIN' : '/xul/server/circ/checkin.xul',
-    'XUL_BACKDATE' : '/xul/server/circ/backdate_post_checkin.xul',
-    'XUL_RENEW' : '/xul/server/circ/renew.xul',
-    'XUL_CHECKOUT' : '/xul/server/circ/checkout.xul',
-    'XUL_CIRC_BRIEF' : '/xul/server/circ/circ_brief.xul',
-    'XUL_CIRC_SUMMARY' : '/xul/server/circ/circ_summary.xul',
-    'XUL_COPY_BUCKETS_QUICK' : '/xul/server/cat/copy_buckets_quick.xul',
-    'XUL_COPY_BUCKETS' : '/xul/server/cat/copy_buckets.xul',
-    'XUL_COPY_DETAILS' : '/xul/server/circ/copy_details.xul',
-    'XUL_COPY_EDITOR' : '/xul/server/cat/copy_editor.xul',
-    'XUL_COPY_LOCATION_EDIT' : '/xul/server/admin/copy_locations.xhtml',
-    'XUL_COPY_NOTES' : '/xul/server/cat/copy_notes.xul',
-    'XUL_COPY_STATUS' : '/xul/server/circ/copy_status.xul',
-    'XUL_COPY_SUMMARY' : '/xul/server/cat/copy_summary.xul',
-    'XUL_COPY_VOLUME_BROWSE' : '/xul/server/cat/copy_browser.xul',
+    'XUL_CHECKIN' : 'oils://remote/xul/server/circ/checkin.xul',
+    'XUL_BACKDATE' : 'oils://remote/xul/server/circ/backdate_post_checkin.xul',
+    'XUL_RENEW' : 'oils://remote/xul/server/circ/renew.xul',
+    'XUL_CHECKOUT' : 'oils://remote/xul/server/circ/checkout.xul',
+    'XUL_CIRC_BRIEF' : 'oils://remote/xul/server/circ/circ_brief.xul',
+    'XUL_CIRC_SUMMARY' : 'oils://remote/xul/server/circ/circ_summary.xul',
+    'XUL_COPY_BUCKETS_QUICK' : 'oils://remote/xul/server/cat/copy_buckets_quick.xul',
+    'XUL_COPY_BUCKETS' : 'oils://remote/xul/server/cat/copy_buckets.xul',
+    'XUL_COPY_DETAILS' : 'oils://remote/xul/server/circ/copy_details.xul',
+    'XUL_COPY_EDITOR' : 'oils://remote/xul/server/cat/copy_editor.xul',
+    'XUL_COPY_LOCATION_EDIT' : 'oils://remote/xul/server/admin/copy_locations.xhtml',
+    'XUL_COPY_NOTES' : 'oils://remote/xul/server/cat/copy_notes.xul',
+    'XUL_COPY_STATUS' : 'oils://remote/xul/server/circ/copy_status.xul',
+    'XUL_COPY_SUMMARY' : 'oils://remote/xul/server/cat/copy_summary.xul',
+    'XUL_COPY_VOLUME_BROWSE' : 'oils://remote/xul/server/cat/copy_browser.xul',
     'XUL_DEBUG_CONSOLE' : 'chrome://global/content/console.xul',
-    'XUL_DEBUG_FIELDMAPPER' : '/xul/server/util/fm_view.xul',
-    'XUL_DEBUG_FILTER_CONSOLE' : '/xul/server/util/filter_console.xul',
-    'XUL_DEBUG_SHELL' : '/xul/server/util/shell.html',
-    'XUL_DEBUG_XULEDITOR' : '/xul/server/util/xuledit.xul',
-    'XUL_DO_NOT_AUTO_ATTEMPT_PRINT_SETTING' : '/xul/server/admin/do_not_auto_attempt_print_setting.xul',
-    'XUL_FANCY_PROMPT' : '/xul/server/util/fancy_prompt.xul',
-    'XUL_HOLD_CAPTURE' : '/xul/server/circ/hold_capture.xul',
-    /*'XUL_HOLD_PULL_LIST' : '/xul/server/admin/hold_pull_list.xhtml',*/
-    'XUL_HOLD_PULL_LIST' : '/xul/server/patron/holds.xul',
-    'XUL_HOLDS_BROWSER' : '/xul/server/patron/holds.xul',
-    'XUL_HOLD_DETAILS' : '/xul/server/patron/hold_details.xul',
-    'XUL_HOLD_CANCEL' : '/xul/server/patron/hold_cancel.xul',
-    'XUL_HOLD_PLACEMENT' : '/xul/server/patron/place_hold.xul',
-    'XUL_IN_HOUSE_USE' : '/xul/server/circ/in_house_use.xul',
-    'XUL_LIST_CLIPBOARD' : '/xul/server/util/list_clipboard.xul',
-    'XUL_LOCAL_ADMIN' : '/xul/server/admin/index.xhtml',
-    'XUL_LOGIN_DATA' : '/xul/server/main/data.xul', 
-    'XUL_MARC_NEW' : '/xul/server/cat/marc_new.xul',
-    'XUL_MARC_EDIT' : '/xul/server/cat/marcedit.xul',
-    'XUL_MARC_VIEW' : '/xul/server/cat/marc_view.xul',
+    'XUL_DEBUG_FIELDMAPPER' : 'oils://remote/xul/server/util/fm_view.xul',
+    'XUL_DEBUG_FILTER_CONSOLE' : 'oils://remote/xul/server/util/filter_console.xul',
+    'XUL_DEBUG_SHELL' : 'oils://remote/xul/server/util/shell.html',
+    'XUL_DEBUG_XULEDITOR' : 'oils://remote/xul/server/util/xuledit.xul',
+    'XUL_DO_NOT_AUTO_ATTEMPT_PRINT_SETTING' : 'oils://remote/xul/server/admin/do_not_auto_attempt_print_setting.xul',
+    'XUL_FANCY_PROMPT' : 'oils://remote/xul/server/util/fancy_prompt.xul',
+    'XUL_HOLD_CAPTURE' : 'oils://remote/xul/server/circ/hold_capture.xul',
+    /*'XUL_HOLD_PULL_LIST' : 'oils://remote/xul/server/admin/hold_pull_list.xhtml',*/
+    'XUL_HOLD_PULL_LIST' : 'oils://remote/xul/server/patron/holds.xul',
+    'XUL_HOLDS_BROWSER' : 'oils://remote/xul/server/patron/holds.xul',
+    'XUL_HOLD_DETAILS' : 'oils://remote/xul/server/patron/hold_details.xul',
+    'XUL_HOLD_CANCEL' : 'oils://remote/xul/server/patron/hold_cancel.xul',
+    'XUL_HOLD_PLACEMENT' : 'oils://remote/xul/server/patron/place_hold.xul',
+    'XUL_IN_HOUSE_USE' : 'oils://remote/xul/server/circ/in_house_use.xul',
+    'XUL_LIST_CLIPBOARD' : 'oils://remote/xul/server/util/list_clipboard.xul',
+    'XUL_LOCAL_ADMIN' : 'oils://remote/xul/server/admin/index.xhtml',
+    'XUL_LOGIN_DATA' : 'oils://remote/xul/server/main/data.xul',
+    'XUL_MARC_NEW' : 'oils://remote/xul/server/cat/marc_new.xul',
+    'XUL_MARC_EDIT' : 'oils://remote/xul/server/cat/marcedit.xul',
+    'XUL_MARC_VIEW' : 'oils://remote/xul/server/cat/marc_view.xul',
     'XUL_MENU_FRAME' : 'chrome://open_ils_staff_client/content/main/menu_frame.xul',
-    'XUL_NON_CAT_LABEL_EDIT' : '/xul/server/admin/non_cat_types.xhtml',
-    'XUL_OFFLINE_UPLOAD_XACTS' : '/xul/server/admin/upload_xacts.xhtml',
-    'XUL_OFFLINE_MANAGE_XACTS' : '/xul/server/admin/offline_manage_xacts.xul',
-    'XUL_OFFLINE_MANAGE_XACTS_CGI' : '/cgi-bin/offline/offline.pl',
-    'XUL_OFFLINE_GENERATE_WIDGETS' : '/xul/server/main/gen_offline_widgets.xul',
-    'XUL_REMOTE_OPAC_WRAPPER' : '/xul/server/cat/opac.xul',
+    'XUL_NON_CAT_LABEL_EDIT' : 'oils://remote/xul/server/admin/non_cat_types.xhtml',
+    'XUL_OFFLINE_UPLOAD_XACTS' : 'oils://remote/xul/server/admin/upload_xacts.xhtml',
+    'XUL_OFFLINE_MANAGE_XACTS' : 'oils://remote/xul/server/admin/offline_manage_xacts.xul',
+    'XUL_OFFLINE_MANAGE_XACTS_CGI' : '/cgi-bin/offline/offline.pl', // Dunno if this needs oils://remote
+    'XUL_OFFLINE_GENERATE_WIDGETS' : 'oils://remote/xul/server/main/gen_offline_widgets.xul',
+    'XUL_REMOTE_OPAC_WRAPPER' : 'oils://remote/xul/server/cat/opac.xul',
     'XUL_OPAC_WRAPPER' : 'chrome://open_ils_staff_client/content/cat/opac.xul',
-    'XUL_PATRON_BARCODE_ENTRY' : '/xul/server/patron/barcode_entry.xul',
-    'XUL_PATRON_BILLS' : '/xul/server/patron/bill2.xul',
-    'XUL_PATRON_BILL_CC_INFO' : '/xul/server/patron/bill_cc_info.xul',
-    'XUL_PATRON_BILL_CHECK_INFO' : '/xul/server/patron/bill_check_info.xul',
-    'XUL_PATRON_BILL_DETAILS' : '/xul/server/patron/bill_details.xul',
-    'XUL_PATRON_BILL_HISTORY' : '/xul/server/patron/bill_history.xul',
-    'XUL_PATRON_BILL_WIZARD' : '/xul/server/patron/bill_wizard.xul',
-    'XUL_PATRON_DISPLAY' : '/xul/server/patron/display.xul',
-    'XUL_PATRON_HORIZ_DISPLAY' : '/xul/server/patron/display_horiz.xul',
-    'XUL_PATRON_EDIT' : '/eg/actor/user/register',
-    'XUL_PATRONS_DUE_REFUNDS' : '/xul/server/admin/patrons_due_refunds.xul',
-    'XUL_USER_PERM_EDITOR' : '/xul/server/patron/user_edit.xhtml',
-    'XUL_PATRON_HOLDS' : '/xul/server/patron/holds.xul',
-    'XUL_PATRON_INFO_NOTES' : '/xul/server/patron/info_notes.xul',
-    'XUL_PATRON_INFO_STAT_CATS' : '/xul/server/patron/info_stat_cats.xul',
-    'XUL_PATRON_INFO_SURVEYS' : '/xul/server/patron/info_surveys.xul',
-    'XUL_PATRON_INFO_GROUP' : '/xul/server/patron/info_group.xul',
-    'XUL_PATRON_ITEMS' : '/xul/server/patron/items.xul',
-    'XUL_PATRON_SEARCH_FORM' : '/xul/server/patron/search_form.xul',
-    'XUL_PATRON_HORIZONTAL_SEARCH_FORM' : '/xul/server/patron/search_form_horiz.xul',
-    'XUL_PATRON_SEARCH_RESULT' : '/xul/server/patron/search_result.xul',
-    'XUL_PATRON_SUMMARY' : '/xul/server/patron/summary.xul',
-    'XUL_PRE_CAT' : '/xul/server/circ/pre_cat_fields.xul',
-    'XUL_PRINT_LIST_TEMPLATE_EDITOR' : '/xul/server/circ/print_list_template_editor.xul',
-    'XUL_RECORD_BUCKETS' : '/xul/server/cat/record_buckets.xul',
-    'XUL_RECORD_BUCKETS_QUICK' : '/xul/server/cat/record_buckets_quick.xul',
-    'XUL_REMOTE_BROWSER' : '/xul/server/util/rbrowser.xul',
-    'XUL_SERIAL_ITEM_EDITOR' : '/xul/server/serial/sitem_editor.xul',
-    'XUL_SERIAL_NOTES' : '/xul/server/serial/notes.xul',
-    'XUL_SERIAL_SELECT_AOU' : '/xul/server/serial/select_aou.xul',
-    'XUL_SERIAL_SELECT_UNIT' : '/xul/server/serial/select_unit.xul',
-    'XUL_SERIAL_SERCTRL_MAIN' : '/xul/server/serial/serctrl_main.xul',
-    'XUL_SPINE_LABEL' : '/xul/server/cat/spine_labels.xul',
-    'XUL_STAGED_PATRONS' : '/xul/server/patron/staged.xul',
+    'XUL_PATRON_BARCODE_ENTRY' : 'oils://remote/xul/server/patron/barcode_entry.xul',
+    'XUL_PATRON_BILLS' : 'oils://remote/xul/server/patron/bill2.xul',
+    'XUL_PATRON_BILL_CC_INFO' : 'oils://remote/xul/server/patron/bill_cc_info.xul',
+    'XUL_PATRON_BILL_CHECK_INFO' : 'oils://remote/xul/server/patron/bill_check_info.xul',
+    'XUL_PATRON_BILL_DETAILS' : 'oils://remote/xul/server/patron/bill_details.xul',
+    'XUL_PATRON_BILL_HISTORY' : 'oils://remote/xul/server/patron/bill_history.xul',
+    'XUL_PATRON_BILL_WIZARD' : 'oils://remote/xul/server/patron/bill_wizard.xul',
+    'XUL_PATRON_DISPLAY' : 'oils://remote/xul/server/patron/display.xul',
+    'XUL_PATRON_HORIZ_DISPLAY' : 'oils://remote/xul/server/patron/display_horiz.xul',
+    'XUL_PATRON_EDIT' : 'oils://remote/eg/actor/user/register',
+    'XUL_PATRONS_DUE_REFUNDS' : 'oils://remote/xul/server/admin/patrons_due_refunds.xul',
+    'XUL_USER_PERM_EDITOR' : 'oils://remote/xul/server/patron/user_edit.xhtml',
+    'XUL_PATRON_HOLDS' : 'oils://remote/xul/server/patron/holds.xul',
+    'XUL_PATRON_INFO_NOTES' : 'oils://remote/xul/server/patron/info_notes.xul',
+    'XUL_PATRON_INFO_STAT_CATS' : 'oils://remote/xul/server/patron/info_stat_cats.xul',
+    'XUL_PATRON_INFO_SURVEYS' : 'oils://remote/xul/server/patron/info_surveys.xul',
+    'XUL_PATRON_INFO_GROUP' : 'oils://remote/xul/server/patron/info_group.xul',
+    'XUL_PATRON_ITEMS' : 'oils://remote/xul/server/patron/items.xul',
+    'XUL_PATRON_SEARCH_FORM' : 'oils://remote/xul/server/patron/search_form.xul',
+    'XUL_PATRON_HORIZONTAL_SEARCH_FORM' : 'oils://remote/xul/server/patron/search_form_horiz.xul',
+    'XUL_PATRON_SEARCH_RESULT' : 'oils://remote/xul/server/patron/search_result.xul',
+    'XUL_PATRON_SUMMARY' : 'oils://remote/xul/server/patron/summary.xul',
+    'XUL_PRE_CAT' : 'oils://remote/xul/server/circ/pre_cat_fields.xul',
+    'XUL_PRINT_LIST_TEMPLATE_EDITOR' : 'oils://remote/xul/server/circ/print_list_template_editor.xul',
+    'XUL_RECORD_BUCKETS' : 'oils://remote/xul/server/cat/record_buckets.xul',
+    'XUL_RECORD_BUCKETS_QUICK' : 'oils://remote/xul/server/cat/record_buckets_quick.xul',
+    'XUL_REMOTE_BROWSER' : 'oils://remote/xul/server/util/rbrowser.xul',
+    'XUL_SERIAL_ITEM_EDITOR' : 'oils://remote/xul/server/serial/sitem_editor.xul',
+    'XUL_SERIAL_NOTES' : 'oils://remote/xul/server/serial/notes.xul',
+    'XUL_SERIAL_SELECT_AOU' : 'oils://remote/xul/server/serial/select_aou.xul',
+    'XUL_SERIAL_SELECT_UNIT' : 'oils://remote/xul/server/serial/select_unit.xul',
+    'XUL_SERIAL_SERCTRL_MAIN' : 'oils://remote/xul/server/serial/serctrl_main.xul',
+    'XUL_SPINE_LABEL' : 'oils://remote/xul/server/cat/spine_labels.xul',
+    'XUL_STAGED_PATRONS' : 'oils://remote/xul/server/patron/staged.xul',
     'XUL_STANDALONE' : 'chrome://open_ils_staff_client/content/circ/offline.xul',
-    'XUL_STANDING_PENALTIES' : '/xul/server/patron/standing_penalties.xul',
-    'XUL_NEW_STANDING_PENALTY' : '/xul/server/patron/new_standing_penalty.xul',
-    'XUL_EDIT_STANDING_PENALTY' : '/xul/server/patron/edit_standing_penalty.xul',
-    'XUL_SCAN_ITEM_AS_MISSING_PIECES' : '/xul/server/circ/missing_pieces.xul',
-    'XUL_STAT_CAT_EDIT' : '/xul/server/admin/stat_cat_editor.xhtml',
+    'XUL_STANDING_PENALTIES' : 'oils://remote/xul/server/patron/standing_penalties.xul',
+    'XUL_NEW_STANDING_PENALTY' : 'oils://remote/xul/server/patron/new_standing_penalty.xul',
+    'XUL_EDIT_STANDING_PENALTY' : 'oils://remote/xul/server/patron/edit_standing_penalty.xul',
+    'XUL_SCAN_ITEM_AS_MISSING_PIECES' : 'oils://remote/xul/server/circ/missing_pieces.xul',
+    'XUL_STAT_CAT_EDIT' : 'oils://remote/xul/server/admin/stat_cat_editor.xhtml',
     'XUL_SURVEY_WIZARD' : 'chrome://open_ils_staff_client/content/admin/survey_wizard.xul',
-    'XUL_TIMESTAMP_DIALOG' : '/xul/server/util/timestamp.xul',
-    'XUL_TOOLBAR_CONFIG' : '/xul/server/admin/toolbar.xul',
-    'XUL_USER_BUCKETS' : '/xul/server/patron/user_buckets.xul',
-    'XUL_VERIFY_CREDENTIALS' : '/xul/server/main/verify_credentials.xul',
-    'XUL_VOLUME_BUCKETS' : '/xul/server/cat/volume_buckets.xul',
-    'XUL_VOLUME_COPY_CREATOR' : '/xul/server/cat/volume_copy_editor.xul',
-    'XUL_VOLUME_COPY_CREATOR_HORIZONTAL' : '/xul/server/cat/volume_copy_editor_horiz.xul',
-    'XUL_VOLUME_COPY_CREATOR_ORIGINAL' : '/xul/server/cat/volume_copy_creator.xul',
-    'XUL_VOLUME_EDITOR' : '/xul/server/cat/volume_editor.xul',
-    'XUL_WORK_LOG' : '/xul/server/admin/work_log.xul',
-    'XUL_WORKSTATION_INFO' : '/xul/server/main/ws_info.xul',
-    'XUL_Z3950_IMPORT' : '/xul/server/cat/z3950.xul',
-    'TEST_HTML' : '/xul/server/main/test.html',
-    'TEST_XUL' : '/xul/server/main/test.xul',
-    'CONIFY' : '/conify/' + LOCALE + '/global',
-    'CONIFY_MANAGE_PARTS' : '/eg/conify/global/biblio/monograph_part',
-    'EG_WEB_BASE' : '/eg',
-    'XUL_LOCAL_ADMIN_BASE' : '/xul/server/admin',
-    'XUL_REPORTS' : '/reports/oils_rpt.xhtml',
+    'XUL_TIMESTAMP_DIALOG' : 'oils://remote/xul/server/util/timestamp.xul',
+    'XUL_TOOLBAR_CONFIG' : 'oils://remote/xul/server/admin/toolbar.xul',
+    'XUL_USER_BUCKETS' : 'oils://remote/xul/server/patron/user_buckets.xul',
+    'XUL_VERIFY_CREDENTIALS' : 'oils://remote/xul/server/main/verify_credentials.xul',
+    'XUL_VOLUME_BUCKETS' : 'oils://remote/xul/server/cat/volume_buckets.xul',
+    'XUL_VOLUME_COPY_CREATOR' : 'oils://remote/xul/server/cat/volume_copy_editor.xul',
+    'XUL_VOLUME_COPY_CREATOR_HORIZONTAL' : 'oils://remote/xul/server/cat/volume_copy_editor_horiz.xul',
+    'XUL_VOLUME_COPY_CREATOR_ORIGINAL' : 'oils://remote/xul/server/cat/volume_copy_creator.xul',
+    'XUL_VOLUME_EDITOR' : 'oils://remote/xul/server/cat/volume_editor.xul',
+    'XUL_WORK_LOG' : 'oils://remote/xul/server/admin/work_log.xul',
+    'XUL_WORKSTATION_INFO' : 'oils://remote/xul/server/main/ws_info.xul',
+    'XUL_Z3950_IMPORT' : 'oils://remote/xul/server/cat/z3950.xul',
+    'TEST_HTML' : '/xul/server/main/test.html', // This is html, not xul....does it need oils://remote?
+    'TEST_XUL' : 'oils://remote/xul/server/main/test.xul',
+    'CONIFY' : 'oils://remote/conify/' + LOCALE + '/global',
+    'CONIFY_MANAGE_PARTS' : 'oils://remote/eg/conify/global/biblio/monograph_part',
+    'EG_WEB_BASE' : 'oils://remote/eg',
+    'XUL_LOCAL_ADMIN_BASE' : 'oils://remote/xul/server/admin',
+    'XUL_REPORTS' : 'oils://remote/reports/oils_rpt.xhtml',
     'EG_ACQ_PO_VIEW' : '/eg/acq/po/view',
     'EG_ACQ_USER_REQUESTS' : '/eg/acq/picklist/user_request',
-    'XUL_SERIAL_BATCH_RECEIVE': '/xul/server/serial/batch_receive.xul',
-    'EG_TRIGGER_EVENTS' : '/eg/actor/user/event_log'
+    'XUL_SERIAL_BATCH_RECEIVE': 'oils://remote/xul/server/serial/batch_receive.xul',
+    'XUL_SERIAL_PATTERN_WIZARD' : '/xul/server/serial/pattern_wizard.xul',
+    'CUSTOM_JS' : '/xul/server/skin/custom.js',
+    'ACQ_LINEITEM' : 'oils://remote/eg/acq/lineitem/related/',
+    'SERIAL_LIST_SUBSCRIPTION' : 'oils://remote/eg/serial/list_subscription',
+    'BOOKING_RESOURCE' : 'oils://remote/eg/conify/global/booking/resource',
+    'BOOKING_RESERVATION' : 'oils://remote/eg/booking/reservation',
+    'BOOKING_PICKUP' : 'oils://remote/eg/booking/pickup',
+    'BOOKING_RETURN' : 'oils://remote/eg/booking/return',
+    'ALT_HOLDS_PRINT' : 'oils://remote/opac/extras/circ/alt_holds_print.html',
+    'SERIAL_PRINT_ROUTING_LIST_USERS' : 'oils://remote/eg/serial/print_routing_list_users',
+    'XUL_SERIAL_BATCH_RECEIVE': 'oils://remote/xul/server/serial/batch_receive.xul',
+    'EG_TRIGGER_EVENTS' : 'oils://remote/eg/actor/user/event_log'
 }
 
 if(use_tpac) {
-    urls['opac'] = '/eg/opac/advanced';
-    urls['opac_rdetail'] = '/eg/opac/record/';
-    urls['opac_rresult'] = '/eg/opac/results';
-    urls['opac_rresult_metarecord'] = '/eg/opac/results?metarecord=';
+    urls['opac'] = 'oils://remote/eg/opac/advanced';
+    urls['opac_rdetail'] = 'oils://remote/eg/opac/record/';
+    urls['opac_rresult'] = 'oils://remote/eg/opac/results';
+    urls['opac_rresult_metarecord'] = 'oils://remote/eg/opac/results?metarecord=';
     urls['browser'] = urls.opac;
     pref.setBoolPref('oils.secure_opac',true);
 }
index 73983c3..44d7f72 100644 (file)
@@ -8,20 +8,6 @@ var openTabs = new Array();
 var tempWindow = null;
 var tempFocusWindow = null;
 
-function grant_perms(url) {
-    var perms = "UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead";
-    dump('Granting ' + perms + ' to ' + url + '\n');
-    if (G.pref) {
-        G.pref.setCharPref("capability.principal.codebase.p0.granted", perms);
-        G.pref.setCharPref("capability.principal.codebase.p0.id", url);
-        G.pref.setCharPref("capability.principal.codebase.p1.granted", perms);
-        G.pref.setCharPref("capability.principal.codebase.p1.id", url.replace('http:','https:'));
-        G.pref.setBoolPref("dom.disable_open_during_load",false);
-        G.pref.setBoolPref("browser.popups.showPopupBlocker",false);
-    }
-
-}
-
 function clear_the_cache() {
     try {
         var cacheClass         = Components.classes["@mozilla.org/network/cache-service;1"];
@@ -79,7 +65,6 @@ function new_tabs(aTabList, aContinue) {
         openTabs = openTabs.concat(aTabList);
     }
     if(G.data.session) { // Just add to the list of stuff to open unless we are logged in
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var targetwindow = null;
         var focuswindow = null;
         var focustab = {'focus' : true};
@@ -233,18 +218,36 @@ function get_menu_perms(indocument) {
 function load_hotkey_sets() {
     if(typeof(load_hotkey_sets.set_list) == 'undefined') {
         load_hotkey_sets.set_list = [];
-        JSAN.use('util.file');
-        var file = new util.file();
-        var dirEntries = file.get('hotkeys','skin').directoryEntries;
-        while(dirEntries.hasMoreElements()) {
-            var entry = dirEntries.getNext();
-            entry.QueryInterface(Components.interfaces.nsIFile);
-            if(!entry.isFile()) continue;
-            if(!entry.leafName.match(/.+\.keyset$/)) continue;
-            var keysetname = entry.leafName.replace(/\.keyset$/,'');
-            load_hotkey_sets.set_list.push(keysetname);
+        // We can't safely use util.file here because extensions aren't unpacked in Firefox 4+
+        // So instead we will use and parse information from a chrome:// URL
+        var hotkeysBase = 'chrome://open_ils_staff_client/skin/hotkeys/';
+        var ioService=Components.classes["@mozilla.org/network/io-service;1"]
+            .getService(Components.interfaces.nsIIOService);
+        var scriptableStream=Components
+            .classes["@mozilla.org/scriptableinputstream;1"]
+            .getService(Components.interfaces.nsIScriptableInputStream);
+
+        var channel=ioService.newChannel(hotkeysBase,null,null);
+        var input=channel.open();
+        var str = '';
+        scriptableStream.init(input);
+        try {
+            while(input.available()) {
+                str+=scriptableStream.read(input.available());
+            }
+        } catch (E) {}
+        scriptableStream.close();
+        input.close();
+        // str now, in theory, has a list of files (and metadata) for our base chrome URL.
+        str = str.replace(/^(?!201: ).*$/gm,''); // Remove non-filename result lines
+        str = str.replace(/^(?!.*\.keyset).*$/gm,''); // Remove non-keyset file result lines
+        str = str.replace(/^201: (.*)\.keyset.*$/gm, "$1"); // Reduce keyset matches to just base names
+        // Split into an array
+        var files = str.trim().split(/[\r\n]+/g);
+        for (var i = 0; i < files.length; i++) {
+            if(files[i].length = 0) continue;
+            load_hotkey_sets.set_list.push(files[i]);
         }
-        file.close();
     }
     return load_hotkey_sets.set_list;
 }
@@ -256,41 +259,51 @@ function get_hotkey_array(keyset_name) {
     }
     if(get_hotkey_array.keyset_cache[keyset_name])
         return get_hotkey_array.keyset_cache[keyset_name];
-    JSAN.use('util.file');
-    var file = new util.file();
-    var keyset_raw;
+    // We can't safely use util.file here because extensions aren't unpacked in Firefox 4+
+    // So instead we will use and parse information from a chrome:// URL
+    var hotkeysBase = 'chrome://open_ils_staff_client/skin/hotkeys/' + keyset_name + '.keyset';
+    var ioService=Components.classes["@mozilla.org/network/io-service;1"]
+        .getService(Components.interfaces.nsIIOService);
+    var scriptableStream=Components
+        .classes["@mozilla.org/scriptableinputstream;1"]
+        .getService(Components.interfaces.nsIScriptableInputStream);
+
+    var channel=ioService.newChannel(hotkeysBase,null,null);
+    var input=channel.open();
+    var keyset_raw = '';
+    scriptableStream.init(input);
     try {
-        var keyset_file = file.get('hotkeys','skin');
-        keyset_file.append(keyset_name + ".keyset");
-        keyset_raw = file.get_content();
-        file.close();
-        var tempArray = [];
-
-        var keyset_lines = keyset_raw.trim().split("\n");
-        for(var line = 0; line < keyset_lines.length; line++) {
-            // Grab line, strip comments, strip leading/trailing whitespace
-            var curline = keyset_lines[line].replace(/\s*#.*$/,'').trim();
-            if(curline == "") continue; // Skip empty lines
-            // Split into pieces
-            var split_line = curline.split(',');
-            // We need at least 3 elements. Command, modifiers, keycode.
-            if(split_line.length < 3) continue;
-            // Trim each segment
-            split_line[0] = split_line[0].trim();
-            split_line[1] = split_line[1].trim();
-            split_line[2] = split_line[2].trim();
-            if(split_line.length > 3)
-                split_line[3] = split_line[3].trim();
-            // Skip empty commands
-            if(split_line[0] == "") continue;
-            // Push to array
-            tempArray.push(split_line);
+        while(input.available()) {
+            keyset_raw+=scriptableStream.read(input.available());
         }
-        get_hotkey_array.keyset_cache[keyset_name] = tempArray;
-        return tempArray;
-    } catch(E) { // Something went wrong.
-        return false;
+    } catch (E) {}
+    scriptableStream.close();
+    input.close();
+
+    var tempArray = [];
+
+    var keyset_lines = keyset_raw.trim().split("\n");
+    for(var line = 0; line < keyset_lines.length; line++) {
+        // Grab line, strip comments, strip leading/trailing whitespace
+        var curline = keyset_lines[line].replace(/\s*#.*$/,'').trim();
+        if(curline == "") continue; // Skip empty lines
+        // Split into pieces
+        var split_line = curline.split(',');
+        // We need at least 3 elements. Command, modifiers, keycode.
+        if(split_line.length < 3) continue;
+        // Trim each segment
+        split_line[0] = split_line[0].trim();
+        split_line[1] = split_line[1].trim();
+        split_line[2] = split_line[2].trim();
+        if(split_line.length > 3)
+            split_line[3] = split_line[3].trim();
+        // Skip empty commands
+        if(split_line[0] == "") continue;
+        // Push to array
+        tempArray.push(split_line);
     }
+    get_hotkey_array.keyset_cache[keyset_name] = tempArray;
+    return tempArray;
 }
 
 function main_init() {
@@ -301,6 +314,17 @@ function main_init() {
             openTabs = openTabs.concat(window.arguments[0].wrappedJSObject.openTabs);
         }
 
+        // Disable commands that we can't do anything with right now
+        if(typeof start_venkman != 'function') {
+            document.getElementById('cmd_debugger').setAttribute('disabled','true');
+        }
+        if(typeof inspectDOMDocument != 'function') {
+            document.getElementById('cmd_inspector').setAttribute('disabled','true');
+        }
+        if(typeof startChromeList != 'function') {
+            document.getElementById('cmd_chrome_list').setAttribute('disabled','true');
+        }
+
         // Now we can safely load the strings without the cache getting wiped
         offlineStrings = document.getElementById('offlineStrings');
         authStrings = document.getElementById('authStrings');
@@ -322,9 +346,6 @@ function main_init() {
         
         G.pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
         G.pref.QueryInterface(Components.interfaces.nsIPrefBranch2);
-        if (! G.pref.prefHasUserValue('general.useragent.override')) {
-            G.pref.setCharPref('general.useragent.override',navigator.userAgent + ' oils_xulrunner /xul/server/');
-        }
 
         JSAN.use('util.error');
         G.error = new util.error();
@@ -356,28 +377,22 @@ function main_init() {
 
             G.data.server_unadorned = url; G.data.stash('server_unadorned'); G.data.stash_retrieve();
 
-            if (! url.match( '^http://' ) ) { url = 'http://' + url; }
+            if (! url.match( '^(http|https)://' ) ) { url = 'http://' + url; }
 
             G.data.server = url; G.data.stash('server'); 
             G.data.session = { 'key' : G.auth.session.key, 'auth' : G.auth.session.authtime }; G.data.stash('session');
             G.data.stash_retrieve();
             try {
                 var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
-                var cookieUri = ios.newURI("http://" + G.data.server_unadorned, null, null);
                 var cookieUriSSL = ios.newURI("https://" + G.data.server_unadorned, null, null);
                 var cookieSvc = Components.classes["@mozilla.org/cookieService;1"].getService(Components.interfaces.nsICookieService);
 
-                cookieSvc.setCookieString(cookieUri, null, "ses="+G.data.session.key, null);
-                cookieSvc.setCookieString(cookieUriSSL, null, "ses="+G.data.session.key, null);
-                cookieSvc.setCookieString(cookieUri, null, "xul=1", null);
-                cookieSvc.setCookieString(cookieUriSSL, null, "xul=1", null);
+                cookieSvc.setCookieString(cookieUriSSL, null, "ses="+G.data.session.key + "; secure;", null);
 
             } catch(E) {
                 alert(offlineStrings.getFormattedString(main.session_cookie.error, [E]));
             }
 
-            grant_perms(url);
-
             xulG = {
                 'auth' : G.auth,
                 'url' : url,
@@ -391,7 +406,7 @@ function main_init() {
                 var deck = document.getElementById('progress_space');
                 util.widgets.remove_children( deck );
                 var iframe = document.createElement('iframe'); deck.appendChild(iframe);
-                iframe.setAttribute( 'src', url + urls.XUL_LOGIN_DATA );
+                iframe.setAttribute( 'src', urls.XUL_LOGIN_DATA );
                 iframe.contentWindow.xulG = xulG;
                 G.data_xul = iframe.contentWindow;
             } else {
@@ -399,7 +414,7 @@ function main_init() {
                 var deck = G.auth.controller.view.ws_deck;
                 JSAN.use('util.widgets'); util.widgets.remove_children('ws_deck');
                 var iframe = document.createElement('iframe'); deck.appendChild(iframe);
-                iframe.setAttribute( 'src', url + urls.XUL_WORKSTATION_INFO );
+                iframe.setAttribute( 'src', urls.XUL_WORKSTATION_INFO );
                 iframe.contentWindow.xulG = xulG;
                 deck.selectedIndex = deck.childNodes.length - 1;
             }
@@ -750,6 +765,7 @@ function handle_migration() {
 }
 
 function auto_login(loginInfo) {
+    G.data.stash_retrieve();
     if(G.data.session) return; // We are logged in. No auto-logoff supported.
     if(loginInfo.host) G.auth.controller.view.server_prompt.value = loginInfo.host;
     if(loginInfo.user) G.auth.controller.view.name_prompt.value = loginInfo.user;
index d10c503..a3bd477 100644 (file)
@@ -6,7 +6,6 @@ var offlineStrings;
 if (typeof main == 'undefined') main = {};
 main.menu = function () {
 
-    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
     offlineStrings = document.getElementById('offlineStrings');
     JSAN.use('util.error'); this.error = new util.error();
     JSAN.use('util.window'); this.window = new util.window();
@@ -39,6 +38,14 @@ main.menu.prototype = {
     'toolbar_labelpos' : 'side',
 
     'url_prefix' : function(url,secure) {
+        // This allows urls to start with a urls key (or be only a urls key)
+        // We stop at the first / or ? to allow extra paths and query strings.
+        var base_url = url.match(/^[^?/|]+/);
+        if(base_url) {
+            base_url = base_url[0];
+            if(urls[base_url])
+                url = url.replace(/^[^?/|]+\|?/, urls[base_url]);
+        }
         // if host unspecified URL with leading /, prefix the remote hostname
         if (url.match(/^\//)) url = urls.remote + url;
         // if it starts with http:// and we want secure, convert to https://
@@ -46,7 +53,7 @@ main.menu.prototype = {
             url = url.replace(/^http:\/\//, 'https://');
         }
         // if it doesn't start with a known protocol, add http(s)://
-        if (! url.match(/^(http|https|chrome):\/\//) && ! url.match(/^data:/) ) {
+        if (! url.match(/^(http|https|chrome|oils):\/\//) && ! url.match(/^data:/) ) {
             url = secure
                 ? 'https://' + url
                 : 'http://' + url;
@@ -64,12 +71,31 @@ main.menu.prototype = {
         xulG.get_barcode = this.get_barcode;
         xulG.get_barcode_and_settings = this.get_barcode_and_settings;
 
+        // Disable commands that we can't do anything with right now
+        if(typeof xulG.window.win.start_venkman != 'function') {
+            var element = document.getElementById('cmd_debug_venkman');
+            element.setAttribute('disabled','true');
+            element.removeAttribute('perm');
+        }
+        if(typeof xulG.window.win.inspectDOMDocument != 'function') {
+            var element = document.getElementById('cmd_debug_inspector');
+            element.setAttribute('disabled','true');
+            element.removeAttribute('perm');
+        }
+        if(typeof xulG.window.win.startChromeList != 'function') {
+            var element = document.getElementById('cmd_debug_chrome_list');
+            element.setAttribute('disabled','true');
+            element.removeAttribute('perm');
+        }
+
+
         // Pull in local customizations
         var r = new XMLHttpRequest();
-        r.open("GET", obj.url_prefix('/xul/server/skin/custom.js'), false);
+        var custom_js = obj.url_prefix('CUSTOM_JS');
+        r.open("GET", custom_js, false);
         r.send(null);
         if (r.status == 200) {
-            dump('Evaluating /xul/server/skin/custom.js\n');
+            dump('Evaluating ' + custom_js + '\n');
             eval( r.responseText );
         }
 
@@ -126,7 +152,7 @@ main.menu.prototype = {
             label = offlineStrings.getString(labelKey);
 
             // URL
-            var loc = urls.XUL_BROWSER + '?url=' + window.escape( obj.url_prefix(urls.CONIFY) + '/' + path + '.html');
+            var loc = urls.XUL_BROWSER + '?url=' + window.escape( obj.url_prefix('CONIFY/') + path + '.html');
 
             obj.command_tab(
                 event,
@@ -143,7 +169,7 @@ main.menu.prototype = {
             label = offlineStrings.getString(labelKey);
 
             // URL
-            var loc = urls.XUL_BROWSER + '?url=' + window.escape( obj.url_prefix(urls.XUL_LOCAL_ADMIN_BASE) + '/' + path);
+            var loc = urls.XUL_BROWSER + '?url=' + window.escape( obj.url_prefix('XUL_LOCAL_ADMIN_BASE/') + path);
             if(addSes) loc += window.escape('?ses=' + ses());
 
             obj.command_tab( 
@@ -162,7 +188,7 @@ main.menu.prototype = {
             var label = offlineStrings.getString(labelKey);
 
             // URL
-            var loc = urls.XUL_BROWSER + '?url=' + window.escape(obj.url_prefix(urls.EG_WEB_BASE) + '/' + path);
+            var loc = urls.XUL_BROWSER + '?url=' + window.escape(obj.url_prefix('EG_WEB_BASE/') + path);
 
             obj.command_tab(
                 event,
@@ -252,28 +278,28 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_COPY_BUCKETS),{'tab_name':offlineStrings.getString('menu.cmd_edit_copy_buckets.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_COPY_BUCKETS'),{'tab_name':offlineStrings.getString('menu.cmd_edit_copy_buckets.tab')},{});
                 }
             ],
             'cmd_edit_volume_buckets' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_VOLUME_BUCKETS),{'tab_name':offlineStrings.getString('menu.cmd_edit_volume_buckets.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_VOLUME_BUCKETS'),{'tab_name':offlineStrings.getString('menu.cmd_edit_volume_buckets.tab')},{});
                 }
             ],
             'cmd_edit_record_buckets' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_RECORD_BUCKETS),{'tab_name':offlineStrings.getString('menu.cmd_edit_record_buckets.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_RECORD_BUCKETS'),{'tab_name':offlineStrings.getString('menu.cmd_edit_record_buckets.tab')},{});
                 }
             ],
             'cmd_edit_user_buckets' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_USER_BUCKETS),{'tab_name':offlineStrings.getString('menu.cmd_edit_user_buckets.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_USER_BUCKETS'),{'tab_name':offlineStrings.getString('menu.cmd_edit_user_buckets.tab')},{});
                 }
             ],
 
@@ -373,7 +399,7 @@ main.menu.prototype = {
                 function(event) {
                     obj.data.stash_retrieve();
                     var content_params = { 'session' : ses(), 'authtime' : ses('authtime') };
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_OPAC_WRAPPER), {'tab_name':offlineStrings.getString('menu.cmd_search_opac.tab')}, content_params);
+                    obj.command_tab(event,obj.url_prefix('XUL_OPAC_WRAPPER'), {'tab_name':offlineStrings.getString('menu.cmd_search_opac.tab')}, content_params);
                 }
             ],
             'cmd_search_tcn' : [
@@ -384,7 +410,7 @@ main.menu.prototype = {
                     function spawn_tcn(r,event) {
                         for (var i = 0; i < r.count; i++) {
                             var id = r.ids[i];
-                            var opac_url = obj.url_prefix( urls.opac_rdetail ) + id;
+                            var opac_url = obj.url_prefix('opac_rdetail') + id;
                             obj.data.stash_retrieve();
                             var content_params = { 
                                 'session' : ses(), 
@@ -394,13 +420,13 @@ main.menu.prototype = {
                             if (i == 0) {
                                 obj.command_tab(
                                     event,
-                                    obj.url_prefix(urls.XUL_OPAC_WRAPPER), 
+                                    obj.url_prefix('XUL_OPAC_WRAPPER'), 
                                     {'tab_name':tcn}, 
                                     content_params
                                 );
                             } else {
                                 obj.new_tab(
-                                    obj.url_prefix(urls.XUL_OPAC_WRAPPER), 
+                                    obj.url_prefix('XUL_OPAC_WRAPPER'), 
                                     {'tab_name':tcn}, 
                                     content_params
                                 );
@@ -434,7 +460,7 @@ main.menu.prototype = {
                     var bib_id = prompt(offlineStrings.getString('menu.cmd_search_bib_id.tab'),'',offlineStrings.getString('menu.cmd_search_bib_id.prompt'));
                     if (!bib_id) return;
 
-                    var opac_url = obj.url_prefix( urls.opac_rdetail ) + bib_id;
+                    var opac_url = obj.url_prefix('opac_rdetail') + bib_id;
                     var content_params = { 
                         'session' : ses(), 
                         'authtime' : ses('authtime'),
@@ -442,7 +468,7 @@ main.menu.prototype = {
                     };
                     obj.command_tab(
                         event,
-                        obj.url_prefix(urls.XUL_OPAC_WRAPPER), 
+                        obj.url_prefix('XUL_OPAC_WRAPPER'), 
                         {'tab_name':'#' + bib_id}, 
                         content_params
                     );
@@ -452,7 +478,7 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_COPY_STATUS),{},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_COPY_STATUS'),{},{});
                 }
             ],
 
@@ -483,13 +509,13 @@ main.menu.prototype = {
                     }
 
                     function spawn_editor(p) {
-                        var url = urls.XUL_PATRON_EDIT;
+                        var url = 'XUL_PATRON_EDIT';
                         var param_count = 0;
                         for (var i in p) {
                             if (param_count++ == 0) url += '?'; else url += '&';
                             url += i + '=' + window.escape(p[i]);
                         }
-                        var loc = obj.url_prefix( urls.XUL_BROWSER ) + '?url=' + window.escape( obj.url_prefix(url) );
+                        var loc = obj.url_prefix('XUL_BROWSER?url=') + window.escape( obj.url_prefix(url) );
                         obj.new_tab(
                             loc, 
                             {}, 
@@ -506,8 +532,8 @@ main.menu.prototype = {
                     }
 
                     obj.data.stash_retrieve();
-                    var loc = obj.url_prefix( urls.XUL_BROWSER 
-                        + '?url=' + window.escape( obj.url_prefix(urls.XUL_PATRON_EDIT) );
+                    var loc = obj.url_prefix('XUL_BROWSER?url='
+                        + window.escape( obj.url_prefix('XUL_PATRON_EDIT') );
                     obj.command_tab(
                         event,
                         loc, 
@@ -529,42 +555,42 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_STAGED_PATRONS),{'tab_name':offlineStrings.getString('menu.circulation.staged_patrons.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_STAGED_PATRONS'),{'tab_name':offlineStrings.getString('menu.circulation.staged_patrons.tab')},{});
                 }
             ],
             'cmd_circ_checkin' : [
                 ['oncommand'],
                 function(event) { 
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_CHECKIN),{},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_CHECKIN'),{},{});
                 }
             ],
             'cmd_circ_renew' : [
                 ['oncommand'],
                 function(event) { 
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_RENEW),{},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_RENEW'),{},{});
                 }
             ],
             'cmd_circ_checkout' : [
                 ['oncommand'],
                 function(event) { 
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_PATRON_BARCODE_ENTRY),{},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_PATRON_BARCODE_ENTRY'),{},{});
                 }
             ],
             'cmd_circ_hold_capture' : [
                 ['oncommand'],
                 function(event) { 
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_CHECKIN)+'?hold_capture=1',{},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_CHECKIN?hold_capture=1'),{},{});
                 }
             ],
             'cmd_browse_holds_shelf' : [
                 ['oncommand'],
                 function(event) { 
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_HOLDS_BROWSER)+'?shelf=1',{ 'tab_name' : offlineStrings.getString('menu.cmd_browse_holds_shelf.tab') },{});
+                    obj.command_tab(event,obj.url_prefix('XUL_HOLDS_BROWSER?shelf=1'),{ 'tab_name' : offlineStrings.getString('menu.cmd_browse_holds_shelf.tab') },{});
                 }
             ],
             'cmd_clear_holds_shelf' : [
@@ -589,7 +615,7 @@ main.menu.prototype = {
                 function(event) { 
                     obj.data.stash_retrieve();
                     var loc = urls.XUL_BROWSER + '?url=' + window.escape(
-                        obj.url_prefix(urls.XUL_HOLD_PULL_LIST)
+                        obj.url_prefix('XUL_HOLD_PULL_LIST')
                     );
                     obj.command_tab(event, loc, {'tab_name' : offlineStrings.getString('menu.cmd_browse_hold_pull_list.tab')} );
                 }
@@ -599,21 +625,21 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) { 
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_IN_HOUSE_USE),{},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_IN_HOUSE_USE'),{},{});
                 }
             ],
 
             'cmd_scan_item_as_missing_pieces' : [
                 ['oncommand'],
                 function() { 
-                    xulG.window.open(obj.url_prefix(urls.XUL_SCAN_ITEM_AS_MISSING_PIECES),'scan_missing_pieces','chrome'); 
+                    xulG.window.open(obj.url_prefix('XUL_SCAN_ITEM_AS_MISSING_PIECES'),'scan_missing_pieces','chrome'); 
                 }
             ],
 
             'cmd_standalone' : [
                 ['oncommand'],
                 function() { 
-                    //obj.set_tab(obj.url_prefix(urls.XUL_STANDALONE),{},{});
+                    //obj.set_tab(obj.url_prefix('XUL_STANDALONE'),{},{});
                     window.open(urls.XUL_STANDALONE,'Offline','chrome,resizable');
                 }
             ],
@@ -621,9 +647,9 @@ main.menu.prototype = {
             'cmd_local_admin' : [
                 ['oncommand'],
                 function(event) { 
-                    //obj.set_tab(obj.url_prefix(urls.XUL_LOCAL_ADMIN)+'?ses='+window.escape(ses())+'&session='+window.escape(ses()),{},{});
+                    //obj.set_tab(obj.url_prefix('XUL_LOCAL_ADMIN')+'?ses='+window.escape(ses())+'&session='+window.escape(ses()),{},{});
                     var loc = urls.XUL_BROWSER + '?url=' + window.escape(
-                        obj.url_prefix( urls.XUL_LOCAL_ADMIN+'?ses='+window.escape(ses())+'&session='+window.escape(ses()) )
+                        obj.url_prefix( 'XUL_LOCAL_ADMIN?ses='+window.escape(ses())+'&session='+window.escape(ses()) )
                     );
                     obj.command_tab(
                         event,
@@ -648,7 +674,7 @@ main.menu.prototype = {
             'cmd_local_admin_reports' : [
                 ['oncommand'],
                 function(event) { 
-                    var loc = urls.XUL_BROWSER + '?url=' + window.escape( obj.url_prefix(urls.XUL_REPORTS) + '?ses=' + ses());
+                    var loc = urls.XUL_BROWSER + '?url=' + window.escape( obj.url_prefix('XUL_REPORTS?ses=') + ses());
                     obj.command_tab(
                         event,
                         loc, 
@@ -684,7 +710,7 @@ main.menu.prototype = {
             'cmd_local_admin_do_not_auto_attempt_print_setting' : [
                 ['oncommand'],
                 function(event) { 
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_DO_NOT_AUTO_ATTEMPT_PRINT_SETTING),{'tab_name':offlineStrings.getString('menu.cmd_local_admin_do_not_auto_attempt_print_setting.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_DO_NOT_AUTO_ATTEMPT_PRINT_SETTING'),{'tab_name':offlineStrings.getString('menu.cmd_local_admin_do_not_auto_attempt_print_setting.tab')},{});
                 }
             ],
             'cmd_local_admin_closed_dates' : [
@@ -839,7 +865,7 @@ main.menu.prototype = {
                 function(event) {
                     obj.command_tab(
                         event,
-                        obj.url_prefix(urls.XUL_PATRONS_DUE_REFUNDS),
+                        obj.url_prefix('XUL_PATRONS_DUE_REFUNDS'),
                         { 'tab_name' : offlineStrings.getString('menu.local_admin.patrons_due_refunds.tab') },
                         {}
                     );
@@ -1148,7 +1174,7 @@ main.menu.prototype = {
                         return;
                     }
                     var horizontal_interface = String( obj.data.hash.aous['ui.circ.patron_summary.horizontal'] ) == 'true';
-                    var url = obj.url_prefix( horizontal_interface ? urls.XUL_PATRON_HORIZ_DISPLAY : urls.XUL_PATRON_DISPLAY );
+                    var url = obj.url_prefix( horizontal_interface ? 'XUL_PATRON_HORIZ_DISPLAY' : 'XUL_PATRON_DISPLAY' );
                     obj.command_tab( event, url, {}, { 'id' : obj.data.last_patron } );
                 }
             ],
@@ -1161,7 +1187,7 @@ main.menu.prototype = {
                         alert(offlineStrings.getString('menu.cmd_retrieve_last_record.session.error'));
                         return;
                     }
-                    var opac_url = obj.url_prefix( urls.opac_rdetail ) + obj.data.last_record;
+                    var opac_url = obj.url_prefix('opac_rdetail') + obj.data.last_record;
                     var content_params = {
                         'session' : ses(),
                         'authtime' : ses('authtime'),
@@ -1169,7 +1195,7 @@ main.menu.prototype = {
                     };
                     obj.command_tab(
                         event,
-                        obj.url_prefix(urls.XUL_OPAC_WRAPPER),
+                        obj.url_prefix('XUL_OPAC_WRAPPER'),
                         {'tab_name' : offlineStrings.getString('menu.cmd_retrieve_last_record.status')},
                         content_params
                     );
@@ -1181,7 +1207,7 @@ main.menu.prototype = {
                 function(event) {
                     obj.command_tab(
                         event,
-                        obj.url_prefix(urls.XUL_VERIFY_CREDENTIALS),
+                        obj.url_prefix('XUL_VERIFY_CREDENTIALS'),
                         { 'tab_name' : offlineStrings.getString('menu.cmd_verify_credentials.tabname') },
                         {}
                     );
@@ -1193,14 +1219,14 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_Z3950_IMPORT),{},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_Z3950_IMPORT'),{},{});
                 }
             ],
             'cmd_create_marc' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_MARC_NEW),{},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_MARC_NEW'),{},{});
                 }
             ],
 
@@ -1220,7 +1246,7 @@ main.menu.prototype = {
                 function(event) {
                     obj.command_tab(
                         event,
-                        obj.url_prefix(urls.MARC_BATCH_EDIT),{
+                        obj.url_prefix('MARC_BATCH_EDIT'),{
                             'tab_name' : offlineStrings.getString('menu.cmd_marc_batch_edit.tab')
                         },
                         {}
@@ -1247,14 +1273,11 @@ main.menu.prototype = {
                             obj.data.stash('session');
                             obj.data.stash('menu_perms');
                             try {
-                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                 var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
-                                var cookieUri = ios.newURI("http://" + obj.data.server_unadorned, null, null);
                                 var cookieUriSSL = ios.newURI("https://" + obj.data.server_unadorned, null, null);
                                 var cookieSvc = Components.classes["@mozilla.org/cookieService;1"].getService(Components.interfaces.nsICookieService);
 
-                                cookieSvc.setCookieString(cookieUri, null, "ses="+obj.data.session.key, null);
-                                cookieSvc.setCookieString(cookieUriSSL, null, "ses="+obj.data.session.key, null);
+                                cookieSvc.setCookieString(cookieUriSSL, null, "ses="+obj.data.session.key + "; secure;", null);
 
                         } catch(E) {
                             alert(offlineStrings.getFormattedString(main.session_cookie.error, [E]));
@@ -1282,14 +1305,13 @@ main.menu.prototype = {
             'cmd_manage_offline_xacts' : [
                 ['oncommand'],
                 function(event) {
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_OFFLINE_MANAGE_XACTS), {'tab_name' : offlineStrings.getString('menu.cmd_manage_offline_xacts.tab')}, {});
+                    obj.command_tab(event,obj.url_prefix('XUL_OFFLINE_MANAGE_XACTS'), {'tab_name' : offlineStrings.getString('menu.cmd_manage_offline_xacts.tab')}, {});
                 }
             ],
             'cmd_download_patrons' : [
                 ['oncommand'],
                 function() {
                     try {
-                        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
                         var x = new XMLHttpRequest();
                         var url = 'http://' + XML_HTTP_SERVER + '/standalone/list.txt';
                         x.open("GET",url,false);
@@ -1314,35 +1336,35 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_PATRON_BARCODE_ENTRY), {}, { 'perm_editor' : true });
+                    obj.command_tab(event,obj.url_prefix('XUL_PATRON_BARCODE_ENTRY'), {}, { 'perm_editor' : true });
                 }
             ],
             'cmd_print_list_template_edit' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_PRINT_LIST_TEMPLATE_EDITOR), {}, {});
+                    obj.command_tab(event,obj.url_prefix('XUL_PRINT_LIST_TEMPLATE_EDITOR'), {}, {});
                 }
             ],
             'cmd_stat_cat_edit' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_STAT_CAT_EDIT) + '?ses='+window.escape(ses()), {'tab_name' : offlineStrings.getString('menu.cmd_stat_cat_edit.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_STAT_CAT_EDIT?ses=') + window.escape(ses()), {'tab_name' : offlineStrings.getString('menu.cmd_stat_cat_edit.tab')},{});
                 }
             ],
             'cmd_non_cat_type_edit' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_NON_CAT_LABEL_EDIT) + '?ses='+window.escape(ses()), {'tab_name' : offlineStrings.getString('menu.cmd_non_cat_type_edit.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_NON_CAT_LABEL_EDIT?ses=') + window.escape(ses()), {'tab_name' : offlineStrings.getString('menu.cmd_non_cat_type_edit.tab')},{});
                 }
             ],
             'cmd_copy_location_edit' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_COPY_LOCATION_EDIT) + '?ses='+window.escape(ses()),{'tab_name' : offlineStrings.getString('menu.cmd_copy_location_edit.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_COPY_LOCATION_EDIT?ses=') + window.escape(ses()),{'tab_name' : offlineStrings.getString('menu.cmd_copy_location_edit.tab')},{});
                 }
             ],
             'cmd_test' : [
@@ -1350,59 +1372,59 @@ main.menu.prototype = {
                 function(event) {
                     obj.data.stash_retrieve();
                     var content_params = { 'session' : ses(), 'authtime' : ses('authtime') };
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_OPAC_WRAPPER), {}, content_params);
+                    obj.command_tab(event,obj.url_prefix('XUL_OPAC_WRAPPER'), {}, content_params);
                 }
             ],
             'cmd_test_html' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.TEST_HTML) + '?ses='+window.escape(ses()),{ 'browser' : true },{});
+                    obj.command_tab(event,obj.url_prefix('TEST_HTML?ses=') + window.escape(ses()),{ 'browser' : true },{});
                 }
             ],
             'cmd_test_xul' : [
                 ['oncommand'],
                 function(event) {
                     obj.data.stash_retrieve();
-                    obj.command_tab(event,obj.url_prefix(urls.TEST_XUL) + '?ses='+window.escape(ses()),{ 'browser' : false },{});
+                    obj.command_tab(event,obj.url_prefix('TEST_XUL?ses=') + window.escape(ses()),{ 'browser' : false },{});
                 }
             ],
             'cmd_console' : [
                 ['oncommand'],
                 function(event) {
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_DEBUG_CONSOLE),{'tab_name' : offlineStrings.getString('menu.cmd_console.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_DEBUG_CONSOLE'),{'tab_name' : offlineStrings.getString('menu.cmd_console.tab')},{});
                 }
             ],
             'cmd_shell' : [
                 ['oncommand'],
                 function(event) {
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_DEBUG_SHELL),{'tab_name' : offlineStrings.getString('menu.cmd_shell.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_DEBUG_SHELL'),{'tab_name' : offlineStrings.getString('menu.cmd_shell.tab')},{});
                 }
             ],
             'cmd_xuleditor' : [
                 ['oncommand'],
                 function(event) {
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_DEBUG_XULEDITOR),{'tab_name' : offlineStrings.getString('menu.cmd_xuleditor.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_DEBUG_XULEDITOR'),{'tab_name' : offlineStrings.getString('menu.cmd_xuleditor.tab')},{});
                 }
             ],
             'cmd_fieldmapper' : [
                 ['oncommand'],
                 function(event) {
-                    obj.command_tab(event,obj.url_prefix(urls.XUL_DEBUG_FIELDMAPPER),{'tab_name' : offlineStrings.getString('menu.cmd_fieldmapper.tab')},{});
+                    obj.command_tab(event,obj.url_prefix('XUL_DEBUG_FIELDMAPPER'),{'tab_name' : offlineStrings.getString('menu.cmd_fieldmapper.tab')},{});
                 }
             ],
             'cmd_survey_wizard' : [
                 ['oncommand'],
                 function() {
                     obj.data.stash_retrieve();
-                    xulG.window.open(obj.url_prefix(urls.XUL_SURVEY_WIZARD),'survey_wizard','chrome'); 
+                    xulG.window.open(obj.url_prefix('XUL_SURVEY_WIZARD'),'survey_wizard','chrome'); 
                 }
             ],
             'cmd_public_opac' : [
                 ['oncommand'],
                 function(event) {
                     var loc = urls.XUL_BROWSER + '?url=' + window.escape(
-                        obj.url_prefix(urls.remote)
+                        obj.url_prefix('remote')
                     );
                     obj.command_tab(
                         event,
@@ -1416,7 +1438,6 @@ main.menu.prototype = {
                 ['oncommand'],
                 function clear_the_cache() {
                     try {
-                        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         var cacheClass         = Components.classes["@mozilla.org/network/cache-service;1"];
                         var cacheService    = cacheClass.getService(Components.interfaces.nsICacheService);
                         cacheService.evictEntries(Components.interfaces.nsICache.STORE_ON_DISK);
@@ -1467,7 +1488,6 @@ main.menu.prototype = {
                         obj.data.unsaved_data = 0; // just in case the program doesn't close somehow
                         obj.data.stash('unsaved_data');
                         dump('forcing data.unsaved_data == ' + obj.data.unsaved_data + '\n');
-                        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService();
                         var windowManagerInterface = windowManager.QueryInterface(Components.interfaces.nsIWindowMediator);
                         var enumerator = windowManagerInterface.getEnumerator(null);
@@ -1564,7 +1584,7 @@ main.menu.prototype = {
             'cmd_toolbar_configure' : [
                 ['oncommand'],
                 function(event) {
-                    var url = obj.url_prefix( urls.XUL_TOOLBAR_CONFIG ); 
+                    var url = obj.url_prefix( 'XUL_TOOLBAR_CONFIG' ); 
                     obj.command_tab(event,url,{},{});
                 }
             ],
@@ -1907,7 +1927,6 @@ main.menu.prototype = {
             function() {
                 try {
                     tabscroller.ensureElementIsVisible(tab);
-                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                     if (panel
                         && panel.firstChild 
                         && ( panel.firstChild.nodeName == 'iframe' || panel.firstChild.nodeName == 'browser' )
@@ -2167,13 +2186,13 @@ commands:
     'set_patron_tab' : function(params,content_params,event) {
         var obj = this;
         var horizontal_interface = String( obj.data.hash.aous['ui.circ.patron_summary.horizontal'] ) == 'true';
-        var url = obj.url_prefix( horizontal_interface ? urls.XUL_PATRON_HORIZ_DISPLAY : urls.XUL_PATRON_DISPLAY );
+        var url = obj.url_prefix( horizontal_interface ? 'XUL_PATRON_HORIZ_DISPLAY' : 'XUL_PATRON_DISPLAY' );
         obj.command_tab(event,url,params ? params : {},content_params ? content_params : {});
     },
     'new_patron_tab' : function(params,content_params) {
         var obj = this;
         var horizontal_interface = String( obj.data.hash.aous['ui.circ.patron_summary.horizontal'] ) == 'true';
-        var url = obj.url_prefix( horizontal_interface ? urls.XUL_PATRON_HORIZ_DISPLAY : urls.XUL_PATRON_DISPLAY );
+        var url = obj.url_prefix( horizontal_interface ? 'XUL_PATRON_HORIZ_DISPLAY' : 'XUL_PATRON_DISPLAY' );
         obj.new_tab(url,params ? params : {},content_params ? content_params : {});
     },
     'volume_item_creator' : function(params) {
@@ -2182,9 +2201,9 @@ commands:
         var unified_interface = String( obj.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true';
         if (unified_interface) {
             var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true';
-            url = obj.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR );
+            url = obj.url_prefix( horizontal_interface ? 'XUL_VOLUME_COPY_CREATOR_HORIZONTAL' : 'XUL_VOLUME_COPY_CREATOR' );
         } else {
-            url = obj.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL );
+            url = obj.url_prefix('XUL_VOLUME_COPY_CREATOR_ORIGINAL');
         }
         var w = obj.new_tab(
             url,
@@ -2200,7 +2219,7 @@ commands:
         if (docid) {
             content_params['docid'] = docid;
         }
-        var url = obj.url_prefix( urls.XUL_COPY_VOLUME_BROWSE );
+        var url = obj.url_prefix('XUL_COPY_VOLUME_BROWSE');
         obj.new_tab(url,params || {}, content_params);
     },
     'get_new_session' : function(params) {
@@ -2232,7 +2251,7 @@ commands:
 
     'set_tab' : function(url,params,content_params) {
         var obj = this;
-        if (!url) url = '/xul/server/';
+        if (!url) url = 'oils://remote/xul/server/';
         if (!url.match(/:\/\//) && !url.match(/^data:/)) url = urls.remote + url;
         if (!params) params = {};
         if (!content_params) content_params = {};
@@ -2367,7 +2386,6 @@ commands:
                 dump('creating iframe with src = ' + url + '\n');
                 frame.setAttribute('src',url);
                 try {
-                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                     var cw = frame.contentWindow;
                     if (typeof cw.wrappedJSObject != 'undefined') cw = cw.wrappedJSObject;
                     cw.IAMXUL = true;
@@ -2414,7 +2432,6 @@ commands:
     },
 
     'open_external' : function(url) {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         // first construct an nsIURI object using the ioservice
         var ioservice = Components.classes["@mozilla.org/network/io-service;1"]
                             .getService(Components.interfaces.nsIIOService);
@@ -2514,7 +2531,7 @@ commands:
         if(!xulG.url_prefix) xulG.url_prefix = url_prefix; // Make util.window happy
         JSAN.use('util.window');
         var win = new util.window();
-        var url = url_prefix(urls.XUL_FANCY_PROMPT);
+        var url = url_prefix('XUL_FANCY_PROMPT');
         var title = offlineStrings.getString('barcode_choice.title');
         var xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" flex="1">';
         xml += '<groupbox flex="1" style="overflow: auto; border: solid thin;"><caption label="' + title + '"/>';
index e87e371..e2f4ed9 100644 (file)
@@ -72,7 +72,6 @@
         function my_init() {
             try {
 
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                 if (typeof JSAN == 'undefined') { throw(document.getElementById('offlineStrings').getString('common.jsan.missing')); }
                 JSAN.errorLevel = "die"; // none, warn, or die
                 /*
index 836d2b3..54bd6bb 100644 (file)
                 <menuitem label="&staff.main.menu.admin.venkman.label;" command="cmd_debug_venkman"/>
                 <menuitem label="&staff.main.auth.debug.inspector;" command="cmd_debug_inspector"/>
                 <menuitem label="&staff.main.auth.debug.chrome_list;" command="cmd_debug_chrome_list"/>
-                <menuitem label="&staff.main.menu.admin.ping;" oncommand="try{netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');JSAN.use('util.network'); var n = new util.network(); alert(n.ping());}catch(E){alert(E);}"/>
+                <menuitem label="&staff.main.menu.admin.ping;" oncommand="try{JSAN.use('util.network'); var n = new util.network(); alert(n.ping());}catch(E){alert(E);}"/>
             </menupopup>
         </menu>
     </menupopup>
index 0d63ae1..89b5440 100644 (file)
@@ -34,7 +34,6 @@
     <![CDATA[
         function my_init() {
             try {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                 if (typeof JSAN == 'undefined') { 
                     throw( offlineStrings.getString('common.jsan.missing'));
                 }
index 88c0fe3..fb0078a 100644 (file)
@@ -3,7 +3,6 @@ dump('entering util.browser.js\n');
 if (typeof util == 'undefined') util = {};
 util.browser = function (params) {
     try {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         JSAN.use('util.error'); this.error = new util.error();
     } catch(E) {
         dump('util.browser: ' + E + '\n');
@@ -20,8 +19,6 @@ util.browser.prototype = {
     'init' : function( params ) {
 
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
             var obj = this;
 
             obj.url = params['url'];
@@ -61,7 +58,6 @@ util.browser.prototype = {
                             ['command'],
                             function() {
                                 try {
-                                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                     var content = obj.get_content();
                                     JSAN.use('util.print'); var p = new util.print(obj.printer_context);
                                     var print_params = {};
@@ -103,7 +99,6 @@ util.browser.prototype = {
                             ['command'],
                             function() {
                                 try {
-                                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                     var n = obj.getWebNavigation();
                                     if (n.canGoForward) n.goForward();
                                 } catch(E) {
@@ -116,7 +111,6 @@ util.browser.prototype = {
                             ['command'],
                             function() {
                                 try {
-                                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                     var n = obj.getWebNavigation();
                                     if (n.canGoBack) {
                                         obj.back_button_clicked = true;
@@ -182,7 +176,6 @@ util.browser.prototype = {
                 return;
             }
         }
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var n = obj.getWebNavigation();
         n.reload( Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE );
     },
@@ -190,8 +183,6 @@ util.browser.prototype = {
     'find' : function(text) {
         var obj = this;
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
             function getBrowser() {
                 return obj.controller.view.browser_browser;
             }
@@ -254,7 +245,6 @@ util.browser.prototype = {
 
     'get_content' : function() {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             if (this.controller.view.browser_browser.contentWindow.wrappedJSObject) {
                 return this.controller.view.browser_browser.contentWindow.wrappedJSObject;
             } else {
@@ -271,7 +261,6 @@ util.browser.prototype = {
             var s = '';
             try { s += obj.url + '\n' + obj.get_content().location.href + '\n'; } catch(E) { s+=E + '\n'; }
             if (!obj.push_xulG) return;
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var cw = this.get_content();
             cw.IAMXUL = true;
             cw.XUL_BUILD_ID = '/xul/server/'.split(/\//)[2];
@@ -310,7 +299,6 @@ util.browser.prototype = {
 
     'getWebNavigation' : function() {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var wn = this.controller.view.browser_browser.webNavigation;
             var s = this.url + '\n' + this.get_content().location.href + '\n';
             s += ('getWebNavigation() = ' + wn + '\n');
@@ -322,7 +310,6 @@ util.browser.prototype = {
     },
 
     'updateNavButtons' : function() {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var obj = this; 
         var s = obj.url + '\n' + obj.get_content().location.href + '\n';
         try {
@@ -385,8 +372,6 @@ util.browser.prototype = {
     'buildProgressListener' : function() {
 
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
             var obj = this;
             obj.progressListener = {
                 onProgressChange    : function(webProgress,request,curSelfProgress,maxSelfProgress,curTotalProgress,maxTotalProgress){
@@ -435,7 +420,6 @@ util.browser.prototype = {
                 },
                 onStateChange         : function ( webProgress, request, stateFlags, status) {
                     try {
-                        netscape.security.PrivilegeManager.enablePrivilege( "UniversalXPConnect" );
                         /*dump('browser.js onStateChange('
                             +webProgress
                             +','+request
@@ -491,11 +475,9 @@ util.browser.prototype = {
                                         obj.error.sdump('D_TRACE','calling on_url_load');
                                         var helpers = {
                                             'doc_write' : function(html) {
-                                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                                 obj.get_content().document.write(html);
                                             },
                                             'doc_close' : function() {
-                                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                                 obj.get_content().document.close();
                                             }
                                         }
index d5df55d..4356f62 100644 (file)
@@ -23,7 +23,6 @@
     <!-- BEHAVIOR -->
         <script type="text/javascript">
         var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     </script>
         <scripts id="openils_util_scripts"/>
 
@@ -32,7 +31,6 @@
     <![CDATA[
         function my_init() {
             try {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
                 JSAN.errorLevel = "die"; // none, warn, or die
                 JSAN.addRepository('..');
     </commandset>
 
     <popupset>
-        <popup id="debug_popup">
+        <menupopup id="debug_popup">
             <menuitem label="&common.browser.view_source.label;" accesskey="&common.browser.view_source.accesskey;" command="cmd_view_source" />
             <menuitem label="&common.browser.set_url.label;" accesskey="&common.browser.set_url.accesskey;" command="cmd_debug" />
             <menuitem label="&common.browser.find.label;" accesskey="&common.browser.find.accesskey;" command="cmd_find" />
-        </popup>
+        </menupopup>
     </popupset>
 
     <vbox flex="1">
             <label id="debug" value="Debug" disabled="true" popup="debug_popup" />
             <button id="browser_print" command="cmd_print" hidden="true"/>
         </hbox>
-        <browser id="browser_browser" flex="1" autoscroll="false" type="content"/>
+        <browser id="browser_browser" flex="1" autoscroll="false" type="content" oils_force_external="true" />
     </vbox>
 
 </window>
index e03b3e3..75d225a 100644 (file)
@@ -10,7 +10,6 @@ util.clipboard.EXPORT_TAGS    = { ':all' : util.clipboard.EXPORT_OK };
 
 util.clipboard.cut = function() {
     try {
-        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
         var n = document.popupNode;
         if (n.getAttribute('readonly')=='true') return;
         var v = n.value;
@@ -30,7 +29,6 @@ util.clipboard.cut = function() {
 
 util.clipboard.copy = function() {
     try {
-        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
         var n = document.popupNode;
         var v = n.value;
         var start = n.selectionStart;
@@ -47,7 +45,6 @@ util.clipboard.copy = function() {
 
 util.clipboard.paste = function() {
     try {
-        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
         var n = document.popupNode;
         if (n.getAttribute('readonly')=='true') return;
         var v = n.value;
index 6b3aaad..aa0557d 100644 (file)
@@ -54,7 +54,6 @@ util.deck.prototype = {
 
             if (content_params) {
                 try {
-                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                     this.error.sdump('D_DECK', 'set_iframe\nurl = ' + url + '\nframe.contentWindow = ' + iframe.contentWindow + '\n' + 'content_params = ' + (content_params) );
                     var cw = iframe.contentWindow; 
                     if (typeof iframe.contentWindow.wrappedJSObject != 'undefined') cw = iframe.contentWindow.wrappedJSObject;
@@ -90,7 +89,6 @@ util.deck.prototype = {
         this.node.selectedIndex = this.node.childNodes.length - 1;
         if (content_params) {
             try {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                 this.error.sdump('D_DECK', 'new_iframe\nurl = ' + url + '\nframe.contentWindow = ' + iframe.contentWindow + '\n' + 'content_params = ' + (content_params) );
                 var cw = iframe.contentWindow; 
                 if (typeof iframe.contentWindow.wrappedJSObject != 'undefined') cw = iframe.contentWindow.wrappedJSObject;
index 5ced634..f30605a 100644 (file)
@@ -6,7 +6,6 @@ util.error = function () {
     try {
 
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             this.consoleService = Components.classes['@mozilla.org/consoleservice;1']
                 .getService(Components.interfaces.nsIConsoleService);
         } catch(E) {
@@ -174,7 +173,6 @@ util.error.prototype = {
                 if (this.forceDebugDump || ( this.allowDebugDump && this.sdump_levels[level] && this.sdump_levels[level].debug ) ) this.debug(message);
                 if (this.forceAlertDump || ( this.allowAlertDump && this.sdump_levels[level] && this.sdump_levels[level].alert ) ) alert(message);
                 if (this.forceConsoleDump || ( this.allowConsoleDump && this.sdump_levels[level] && this.sdump_levels[level].console ) ) {
-                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                     if (level=='D_ERROR') {
                         Components.utils.reportError(message);
                     } else {
@@ -183,7 +181,6 @@ util.error.prototype = {
                 }
                 if (this.forceFileDump || ( this.allowFileDump && this.sdump_levels[level] && this.sdump_levels[level].file ) ) {
                     if (level!='D_FILE') {
-                        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         JSAN.use('util.file'); var master_log = new util.file('log');
                         master_log.write_content('append',message); master_log.close();
                         var specific_log = new util.file('log_'+level);
@@ -349,7 +346,6 @@ util.error.prototype = {
         */
 
         dump('yns_alert:\n\ts = ' + s + '\n\ttitle = ' + title + '\n\tb1 = ' + b1 + '\n\tb2 = ' + b2 + '\n\tb3 = ' + b3 + '\n\tc = ' + c + '\n');
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
 
         //FIXME - is that good enough of an escape job?
         s = s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
@@ -423,7 +419,6 @@ util.error.prototype = {
         */
 
         dump('yns_alert_formatted:\n\ts = ' + s + '\n\ttitle = ' + title + '\n\tb1 = ' + b1 + '\n\tb2 = ' + b2 + '\n\tb3 = ' + b3 + '\n\tc = ' + c + '\n');
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
 
         //FIXME - is that good enough of an escape job?
         s = s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
@@ -489,7 +484,6 @@ util.error.prototype = {
         */
 
         dump('yns_alert_original:\n\ts = ' + s + '\n\ttitle = ' + title + '\n\tb1 = ' + b1 + '\n\tb2 = ' + b2 + '\n\tb3 = ' + b3 + '\n\tc = ' + c + '\n');
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
         if (this.sound) { this.sound.bad(); }
 
index e66dded..281ee63 100644 (file)
@@ -38,7 +38,6 @@
 
         function my_init() {
             try {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
                 JSAN.errorLevel = "die"; // none, warn, or die
                 JSAN.addRepository('/xul/server/');
index 48b5e59..bc696dd 100644 (file)
@@ -3,8 +3,6 @@ dump('entering util/file.js\n');
 if (typeof util == 'undefined') util = {};
 util.file = function (fname) {
 
-    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead");
-
     JSAN.use('util.error'); this.error = new util.error();
 
     this.dirService = Components.classes["@mozilla.org/file/directory_service;1"].
@@ -30,7 +28,6 @@ util.file.prototype = {
             if (!fname) throw('Must specify a filename.');
 
             try {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead");
                 var pref = Components.classes["@mozilla.org/preferences-service;1"]
                     .getService(Components.interfaces.nsIPrefBranch);
                 if (!path && pref.getBoolPref("open-ils.write_in_user_chrome_directory")) path = 'uchrome';
@@ -44,10 +41,6 @@ util.file.prototype = {
                     this._file = this.dirService.get( "UChrm",  Components.interfaces.nsIFile );
                     //this._file = this.dirService.get( "ProfD",  Components.interfaces.nsIFile );
                 break;
-                case 'skin' :
-                    this._file = this.dirService.get( "AChrom",  Components.interfaces.nsIFile );
-                    this._file.append("skin");
-                break;
                 default:
                 case 'chrome' : 
                     this._file = this.dirService.get( "AChrom",  Components.interfaces.nsIFile );
@@ -120,7 +113,6 @@ util.file.prototype = {
 
     'write_content' : function(write_type,content) {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead");
             if (!this._output_stream) this._create_output_stream(write_type);
             this._output_stream.write( content, String( content ).length );
         } catch(E) {
@@ -144,8 +136,6 @@ util.file.prototype = {
 
     'get_content' : function() {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead");
-
             if (!this._file) throw('Must .get() a file first.');
             if (!this._file.exists()) throw('File does not exist.');
             
@@ -163,8 +153,6 @@ util.file.prototype = {
         try {
             //dump('_create_input_stream()\n');
             
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead");
-
             if (!this._file) throw('Must .get() a file first.');
             if (!this._file.exists()) throw('File does not exist.');
 
@@ -194,8 +182,6 @@ util.file.prototype = {
         try {
             //dump('_create_output_stream('+param+') for '+this._file.path+'\n');
             
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead");
-
             if (!this._file) throw('Must .get() a file first.');
 
             if (! this._file.exists()) {
@@ -230,7 +216,6 @@ util.file.prototype = {
 
     'pick_file' : function(params) {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             if (typeof params == 'undefined') params = {};
             if (typeof params.mode == 'undefined') params.mode = 'open';
             var nsIFilePicker = Components.interfaces.nsIFilePicker;
@@ -261,7 +246,6 @@ util.file.prototype = {
             if (typeof params == 'undefined') params = {};
             params.mode = 'save';
             if (typeof params.data == 'undefined') throw('Need a .data field to export');
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var f = obj.pick_file( params );
             if (f) {
                 obj._file = f;
@@ -289,7 +273,6 @@ util.file.prototype = {
             var obj = this;
             if (typeof params == 'undefined') params = {};
             params.mode = 'open';
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var f = obj.pick_file(params);
             if (f && f.exists()) {
                 obj._file = f;
index e75d08b..9b3792c 100644 (file)
@@ -53,7 +53,6 @@
 
         function my_init() {
             try {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
                 JSAN.errorLevel = "die"; // none, warn, or die
                 JSAN.addRepository('/xul/server/');
index b17e9b2..9b37385 100644 (file)
@@ -407,7 +407,6 @@ util.list.prototype = {
                 var col_ordinal = col.getAttribute('ordinal'); 
                 my_cols[ col_id ] = { 'hidden' : col_hidden, 'width' : col_width, 'ordinal' : col_ordinal };
             }
-            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
             JSAN.use('util.file'); var file = new util.file('tree_columns_for_'+window.escape(id));
             file.set_object(my_cols);
             file.close();
@@ -438,7 +437,6 @@ util.list.prototype = {
             var my_cols;
             if (! obj.data.hash.aous) { obj.data.hash.aous = {}; }
             if (! obj.data.hash.aous['gui.disable_local_save_columns']) {
-                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
                 JSAN.use('util.file'); var file = new util.file('tree_columns_for_'+window.escape(id));
                 if (file._file.exists()) {
                     my_cols = file.get_object(); file.close();
index 45aa595..f8f2f38 100644 (file)
@@ -39,7 +39,6 @@
 
         function my_init() {
             try {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
                 JSAN.errorLevel = "die"; // none, warn, or die
                 JSAN.addRepository('/xul/server/');
index 5ae387b..a5cbe8c 100644 (file)
@@ -1,6 +1,5 @@
 dump('entering util/mozilla.js\n');
 
-netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
@@ -15,7 +14,6 @@ util.mozilla.EXPORT_TAGS    = { ':all' : util.mozilla.EXPORT_OK };
 util.mozilla.chromeRegistry = function() {
     try {
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         return Cc['@mozilla.org/chrome/chrome-registry;1'].getService(Ci['nsIToolkitChromeRegistry']);
 
     } catch(E) {
@@ -26,7 +24,6 @@ util.mozilla.chromeRegistry = function() {
 util.mozilla.languages = function() {
     try {
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var stringBundles = Cc['@mozilla.org/intl/stringbundle;1'].getService(Ci['nsIStringBundleService']);
         return stringBundles.createBundle('chrome://global/locale/languageNames.properties');
 
@@ -38,7 +35,6 @@ util.mozilla.languages = function() {
 util.mozilla.regions = function() {
     try {
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var stringBundles = Cc['@mozilla.org/intl/stringbundle;1'].getService(Ci['nsIStringBundleService']);
         return stringBundles.createBundle('chrome://global/locale/regionNames.properties');
 
@@ -50,7 +46,6 @@ util.mozilla.regions = function() {
 util.mozilla.prefs = function() {
     try {
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         return Cc['@mozilla.org/preferences-service;1'].getService(Ci['nsIPrefBranch']);
 
     } catch(E) {
index fc2b5a6..e999028 100644 (file)
@@ -327,7 +327,7 @@ util.network.prototype = {
             while ( w = enumerator.getNext() ) {
                 x = w.document.getElementById('oc_menuitem');
 
-                if(!offlinestrings) w.document.getElementById('offlineStrings');
+                if(!offlinestrings) offlinestrings = w.document.getElementById('offlineStrings');
                 if(permlist) w.g.menu.set_menu_access(permlist);
                 if(data.list.au.length > 1) {
                     addCSSClass(w.document.getElementById('main_tabbox'),'operator_change');
@@ -347,7 +347,6 @@ util.network.prototype = {
         var obj = this;
         try {
 
-        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
         var url = urls.XUL_AUTH_SIMPLE;
         if (typeof xulG != 'undefined' && typeof xulG.url_prefix == 'function') url = xulG.url_prefix( url );
         JSAN.use('util.window'); var win = new util.window();
@@ -374,12 +373,10 @@ util.network.prototype = {
             data.stash('session');
             try {
                 var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
-                var cookieUri = ios.newURI("http://" + data.server_unadorned, null, null);
                 var cookieUriSSL = ios.newURI("https://" + data.server_unadorned, null, null);
                 var cookieSvc = Components.classes["@mozilla.org/cookieService;1"].getService(Components.interfaces.nsICookieService);
 
-                cookieSvc.setCookieString(cookieUri, null, "ses="+data.session.key, null);
-                cookieSvc.setCookieString(cookieUriSSL, null, "ses="+data.session.key, null);
+                cookieSvc.setCookieString(cookieUriSSL, null, "ses="+data.session.key + "; secure;", null);
 
             } catch(E) {
                 alert(offineStrings.getFormattedString('main.session_cookie.error', [E]));
@@ -422,7 +419,6 @@ util.network.prototype = {
             var obj = this;
             var robj = obj.get_result(req);
             if (robj != null && robj.ilsevent && robj.ilsevent == 5000) {
-                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
                 if (location.href.match(/^chrome/)) {
                     //alert('Permission denied.');
                 } else {
@@ -489,7 +485,6 @@ util.network.prototype = {
                         return req;
                     }
 
-                    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
                     var xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">' + 
                         '<groupbox><caption label="' + offlineStrings.getString('network.override.exceptions') + '"/>' + 
                         '<grid><columns><column/><column flex="1"/></columns><rows>';
index 166b486..c3ff12b 100644 (file)
@@ -3,8 +3,6 @@ dump('entering util/print.js\n');
 if (typeof util == 'undefined') util = {};
 util.print = function (context) {
 
-    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
     JSAN.use('util.error'); this.error = new util.error();
     JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init( { 'via':'stash' } );
     JSAN.use('util.window'); this.win = new util.window();
@@ -31,8 +29,6 @@ util.print = function (context) {
 util.print.prototype = {
 
     'set_context' : function(context, set_default) {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
         this.context = context || 'default';
         if(set_default) this.default_context = this.context;
     
@@ -136,7 +132,6 @@ util.print.prototype = {
 
             var w;
 
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             obj.data.init({'via':'stash'});
 
             if (typeof obj.data.print_strategy == 'undefined') {
@@ -472,7 +467,6 @@ util.print.prototype = {
         try {
             if (!params) params = {};
 
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             obj.data.init({'via':'stash'});
 
             if (params.print_strategy || obj.data.print_strategy[obj.context] || obj.data.print_strategy['default']) {
@@ -493,7 +487,6 @@ util.print.prototype = {
                                 w = obj.html2txt(temp_w);
                             } catch(E) {
                                 dump('util.print: Could not use w.document.firstChild.innerHTML with ' + w + ': ' + E + '\n');
-                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                 w.getSelection().selectAllChildren(w.document.firstChild);
                                 w = w.getSelection().toString();
                             }
@@ -501,7 +494,6 @@ util.print.prototype = {
                         obj._NSPrint_custom_print(w,silent,params);
                     break;    
                     case 'window.print':
-                        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
                         var originalPrinter = false;
                         if (prefs.prefHasUserValue('print.print_printer')) {
@@ -619,7 +611,6 @@ util.print.prototype = {
     '_NSPrint_webBrowserPrint' : function(w,silent,params) {
         var obj = this;
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var webBrowserPrint = w
                 .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                 .getInterface(Components.interfaces.nsIWebBrowserPrint);
@@ -648,7 +639,6 @@ util.print.prototype = {
     'GetPrintSettings' : function() {
         try {
             //alert('entering GetPrintSettings');
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var pref = Components.classes["@mozilla.org/preferences-service;1"]
                 .getService(Components.interfaces.nsIPrefBranch);
             //alert('pref = ' + pref);
@@ -678,7 +668,6 @@ util.print.prototype = {
 
     'setPrinterDefaultsForSelectedPrinter' : function (aPrintService) {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             if (this.gPrintSettings.printerName == "") {
                 this.gPrintSettings.printerName = aPrintService.defaultPrinterName;
                 //alert('used .defaultPrinterName');
@@ -701,7 +690,6 @@ util.print.prototype = {
 
     'page_settings' : function() {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             this.GetPrintSettings();
             var PO = Components.classes["@mozilla.org/gfx/printsettings-service;1"].getService(Components.interfaces.nsIPrintOptions);
             PO.ShowPrintSetupDialog(this.gPrintSettings);
@@ -713,7 +701,6 @@ util.print.prototype = {
     'load_settings' : function() {
         try {
             var error_msg = '';
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var file = new util.file('gPrintSettings.' + this.context);
             if (file._file.exists()) {
                 temp = file.get_object(); file.close();
@@ -759,7 +746,6 @@ util.print.prototype = {
     'save_settings' : function() {
         try {
             var obj = this;
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var file = new util.file('gPrintSettings.' + this.context);
             if (typeof obj.gPrintSettings == 'undefined') obj.GetPrintSettings();
             if (obj.gPrintSettings) file.set_object(obj.gPrintSettings); 
index 1f0983c..353889a 100644 (file)
@@ -26,7 +26,6 @@
     <!-- BEHAVIOR -->
         <script type="text/javascript">
         var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     </script>
         <scripts id="openils_util_scripts"/>
 
@@ -36,7 +35,6 @@
 
         function my_init() {
             try {
-                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
                 JSAN.errorLevel = "die"; // none, warn, or die
                 JSAN.addRepository('/xul/server/');
     </commandset>
 
     <popupset>
-        <popup id="debug_popup">
+        <menupopup id="debug_popup">
             <menuitem label="&common.browser.view_source.label;" accesskey="&common.browser.view_source.accesskey;" command="cmd_view_source" />
             <menuitem label="&common.browser.set_url.label;" accesskey="&common.browser.set_url.accesskey;" command="cmd_debug" />
             <menuitem label="&common.browser.find.label;" accesskey="&common.browser.find.accesskey;" command="cmd_find" />
-        </popup>
+        </menupopup>
     </popupset>
 
     <vbox flex="1">
             <label id="debug" value="Debug" disabled="true" popup="debug_popup" />
             <button id="browser_print" command="cmd_print" hidden="true"/>
         </hbox>
-        <browser id="browser_browser" flex="1" autoscroll="false" type="content"/>
+        <browser id="browser_browser" flex="1" autoscroll="false" type="content" oils_force_external="true" />
     </vbox>
 
 </window>
index 7dda6e3..747d059 100644 (file)
@@ -11,7 +11,6 @@ lastError = null;
 
 function win_list() {
     var list = [];
-    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
         getService(Components.interfaces.nsIWindowMediator);
     var enumerator = wm.getEnumerator('eg_menu');
@@ -35,7 +34,6 @@ function get_tab(a,b) {
         idx = b;
     }
 
-    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     var tabs = win.document.getElementById('main_tabs');
     var panels = win.document.getElementById('main_panels');
     return { 'name' : tabs.childNodes[idx].getAttribute('label'), 'content' : panels.childNodes[idx].firstChild.contentWindow };
index 0d57f84..f576eaf 100644 (file)
@@ -37,7 +37,6 @@ util.sound = function (params) {
             dump('SOUND('+this.sig+'): starting timer with intervalId = ' + intervalId + '\n');
         }
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var SOUNDContractID = "@mozilla.org/sound;1";
         var SOUNDIID        = Components.interfaces.nsISound;
         this.SOUND          = Components.classes[SOUNDContractID].createInstance(SOUNDIID);
@@ -58,7 +57,6 @@ util.sound.prototype = {
 
     'xp_url_init' : function (aURL) {
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var URLContractID   = "@mozilla.org/network/standard-url;1";
             var URLIID          = Components.classes[URLContractID].createInstance( );
             var URL             = URLIID.QueryInterface(Components.interfaces.nsIURL);
@@ -77,7 +75,6 @@ util.sound.prototype = {
 
         var obj = this;
         try {
-            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
             var url2 = obj.xp_url_init( data.server + url );
             if (typeof data.no_sound == 'undefined' || data.no_sound == false || data.no_sound == 'false') {
index c51689b..35e5319 100644 (file)
@@ -3,7 +3,6 @@ var widget;
 
 function my_init() {
     try {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
         JSAN.errorLevel = "die"; // none, warn, or die
         JSAN.addRepository('/xul/server/');
index bf8b644..e0de11d 100644 (file)
@@ -50,8 +50,6 @@ util.widgets.apply = function(e,attr,attr_value,f) {
 
 util.widgets.save_xml = function (filename,node) {
     try { 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
         JSAN.use('util.file'); var file = new util.file(filename);
 
         node = util.widgets.get(node);
@@ -380,7 +378,6 @@ util.widgets.save_attributes = function (file,ids_attrs) {
                 dump('\telement_id = ' + element_id + '\n');
             }
         }
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         //FIXME - WHY DOES THIS NOT WORK?// JSAN.use('util.file'); var file = new util.file(filename);
         file.set_object(blob); file.close();
     } catch(E) {
@@ -390,7 +387,6 @@ util.widgets.save_attributes = function (file,ids_attrs) {
 
 util.widgets.load_attributes = function (file) {        
     try {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         //FIXME - WHY DOES THIS NOT WORK?// JSAN.use('util.file'); var file = new util.file(filename);
         if (file._file.exists()) {
             var blob = file.get_object(); file.close();
index dbacd79..ddb8cbc 100644 (file)
@@ -35,12 +35,6 @@ util.window.prototype = {
     'SafeWindowOpen' : function (url,title,features) {
         var w;
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesRead");
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
-
         const CI = Components.interfaces;
         const PB = Components.classes["@mozilla.org/preferences-service;1"].getService(CI.nsIPrefBranch);
 
@@ -62,12 +56,6 @@ util.window.prototype = {
     'SafeWindowOpenDialog' : function (url,title,features) {
         var w;
 
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesRead");
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
-
         const CI = Components.interfaces;
         const PB = Components.classes["@mozilla.org/preferences-service;1"].getService(CI.nsIPrefBranch);
 
@@ -87,7 +75,6 @@ util.window.prototype = {
     },
 
     'open' : function(url,title,features,my_xulG) {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var key;
         if (!title) title = '_blank';
         if (!features) features = 'chrome';
@@ -105,6 +92,9 @@ util.window.prototype = {
             } else if (typeof url_prefix == 'function') {
                     key = key.replace( url_prefix('/'), '/' );    
             }
+            // oils://remote/ looks like http://server/ to files loaded off of it. That is, location.pathname ignores it.
+            // So remove it here, like we remove url_prefix.
+            key = key.replace('oils://remote/', '/');
             if (typeof data.modal_xulG_stack[key] == 'undefined') data.modal_xulG_stack[key] = [];
             data.modal_xulG_stack[key].push( my_xulG );
             data.stash('modal_xulG_stack');
@@ -138,7 +128,6 @@ util.window.prototype = {
     },
 
     'openDialog' : function(url,title,features,my_xulG) {
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var key;
         if (!title) title = '_blank';
         if (!features) features = 'chrome'; // Note that this is a default for openDialog anyway
@@ -158,6 +147,9 @@ util.window.prototype = {
             } else if (typeof url_prefix == 'function') {
                     key = key.replace( url_prefix('/'), '/' );    
             }
+            // oils://remote/ looks like http://server/ to files loaded off of it. That is, location.pathname ignores it.
+            // So remove it here, like we remove url_prefix.
+            key = key.replace('oils://remote/', '/');
             if (typeof data.modal_xulG_stack[key] == 'undefined') data.modal_xulG_stack[key] = [];
             data.modal_xulG_stack[key].push( my_xulG );
             data.stash('modal_xulG_stack');
index 8057b3f..e0d2199 100644 (file)
@@ -9,7 +9,7 @@ onload="try { init(); } catch(E) { dump(E+'\n'); alert(E); }">
 <textbox id="ta" multiline="true" wrap="true" flex="1" onkeydown="resetTimeout()"
 value='&lt;?xml version="1.0"?&gt;&#x0A;&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;&#x0A;&lt;window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;&#x0A;&lt;label value="Put your XUL here!"/&gt;&#x0A;&lt;/window&gt;'/>
 <splitter id="split"/>
-<iframe id="content" src="about:blank" flex="1"/>
+<iframe id="content" src="about:blank" flex="1" oils_force_external="true"/>
 <hbox><button id="open" label="Open preview in new window" onclick="openwin()"/><spacer flex="1"/></hbox>
 </vbox>
 </window>
diff --git a/Open-ILS/xul/staff_client/chrome/inspector.jar b/Open-ILS/xul/staff_client/chrome/inspector.jar
deleted file mode 100644 (file)
index f5068c1..0000000
Binary files a/Open-ILS/xul/staff_client/chrome/inspector.jar and /dev/null differ
index b0a7593..85e3d1f 100644 (file)
@@ -2,8 +2,6 @@
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
 @namespace html url("http://www.w3.org/TR/REC-html40"); 
 
-window:not([active="true"]) menubar > menu { color: menutext !important }
-
 *|textarea:focus { background-color: #DDFFDD; }
 *|input:focus { background-color: #DDFFDD; }
 
diff --git a/Open-ILS/xul/staff_client/chrome/venkman.jar b/Open-ILS/xul/staff_client/chrome/venkman.jar
deleted file mode 100644 (file)
index 29c9500..0000000
Binary files a/Open-ILS/xul/staff_client/chrome/venkman.jar and /dev/null differ
index 9ef48f3..89510c1 100644 (file)
@@ -1,27 +1,16 @@
-const nsISupports           = Components.interfaces.nsISupports;\r
-const nsICategoryManager    = Components.interfaces.nsICategoryManager;\r
-const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;\r
-const nsICommandLine        = Components.interfaces.nsICommandLine;\r
-const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;\r
-const nsIFactory            = Components.interfaces.nsIFactory;\r
-const nsIModule             = Components.interfaces.nsIModule;\r
-const nsIWindowWatcher      = Components.interfaces.nsIWindowWatcher;\r
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");\r
 \r
+// This component exists to handle custom command line options\r
+// First up, some useful constants\r
 \r
+// Standalone interface information\r
 const XUL_STANDALONE = "chrome://open_ils_staff_client/content/circ/offline.xul";\r
-const XUL_MAIN = "chrome://open_ils_staff_client/content/main/main.xul";\r
 const WINDOW_STANDALONE = "eg_offline"\r
+// Main (login) window information\r
+const XUL_MAIN = "chrome://open_ils_staff_client/content/main/main.xul";\r
 const WINDOW_MAIN = "eg_main"\r
 \r
-const clh_contractID = "@mozilla.org/commandlinehandler/general-startup;1?type=egcli";\r
-const clh_CID = Components.ID("{7e608198-7355-483a-a85a-20322e4ef91a}");\r
-// category names are sorted alphabetically. Typical command-line handlers use a\r
-// category that begins with the letter "m".\r
-const clh_category = "m-egcli";\r
-\r
-/**\r
- * Utility functions\r
- */\r
+// Useful utility functions\r
 \r
 /**\r
  * Opens a chrome window.\r
@@ -30,221 +19,135 @@ const clh_category = "m-egcli";
  */\r
 function findOrOpenWindow(aWindowType, aChromeURISpec, aName, aArgument, aLoginInfo)\r
 {\r
-  var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].\r
-    getService(Components.interfaces.nsIWindowMediator);\r
-  var targetWindow = wm.getMostRecentWindow(aWindowType);\r
-  if (targetWindow != null) {\r
-      var noFocus = false;\r
-      if(typeof targetWindow.new_tabs == 'function' && aArgument != null) {\r
-          targetWindow.new_tabs(aArgument);\r
-          noFocus = true;\r
-      }\r
-      if(typeof targetWindow.auto_login == 'function' && aLoginInfo != null) {\r
-          targetWindow.auto_login(aLoginInfo);\r
-          noFocus = true;\r
-      }\r
-      if(!noFocus) {\r
-          targetwindow.focus;\r
-      }\r
-  }\r
-  else {\r
-    var params = null;\r
-    if (aArgument != null && aArgument.length != 0 || aLoginInfo != null)\r
-    {\r
-        params = { "openTabs" : aArgument, "loginInfo" : aLoginInfo };\r
-        params.wrappedJSObject = params;\r
-    }\r
-    var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].\r
-        getService(Components.interfaces.nsIWindowWatcher);\r
-    ww.openWindow(null, aChromeURISpec, aName,\r
-        "chrome,resizable,dialog=no", params);\r
-  }\r
-}\r
\r
-/**\r
- * The XPCOM component that implements nsICommandLineHandler.\r
- * It also implements nsIFactory to serve as its own singleton factory.\r
- */\r
-const myAppHandler = {\r
-  /* nsISupports */\r
-  QueryInterface : function clh_QI(iid)\r
-  {\r
-    if (iid.equals(nsICommandLineHandler) ||\r
-        iid.equals(nsIFactory) ||\r
-        iid.equals(nsISupports))\r
-      return this;\r
-\r
-    throw Components.results.NS_ERROR_NO_INTERFACE;\r
-  },\r
-\r
-  /* nsICommandLineHandler */\r
-\r
-  handle : function clh_handle(cmdLine)\r
-  {\r
-    // Each of these options is used for opening a new tab, either on login or remote send.\r
-    // XULRunner does some sanitize to turn /ilsblah into -ilsblah, for example.\r
-    // In addition to the ones here, -ilslogin, -ilsoffline, and -ilsstandalone\r
-    // are defined below.\r
-\r
-    // With the exception of 'new', 'tab', and 'init', the value is checked for in urls in main.js.\r
-\r
-    // NOTE: The option itself should be all lowercase (we .toLowerCase below)\r
-    var options = {\r
-    '-ilscheckin' : 'XUL_CHECKIN',\r
-    '-ilscheckout' : 'XUL_PATRON_BARCODE_ENTRY',\r
-    '-ilsnew' : 'new', // 'new' is a special keyword for opening a new window\r
-    '-ilstab' : 'tab', // 'tab' is a special keyword for opening a new tab with the default content\r
-    '-ilsnew_default' : 'init', // 'init' is a special keyword for opening a new window with an initial default tab\r
-    };\r
-\r
-    var inParams = new Array();\r
-    var loginInfo = {};\r
-    var loginInfoProvided = false;\r
-       var position = 0;\r
-       while (position < cmdLine.length) {\r
-               var arg = cmdLine.getArgument(position).toLowerCase();\r
-               if (options[arg] != undefined) {\r
-                       inParams.push(options[arg]);\r
-                       cmdLine.removeArguments(position,position);\r
-                       continue;\r
-               }\r
-        if (arg == '-ilsurl' && cmdLine.length > position) {\r
-                 inParams.push(cmdLine.getArgument(position + 1));\r
-                 cmdLine.removeArguments(position, position + 1);\r
-                 continue;\r
-               }\r
-        if (arg == '-ilshost' && cmdLine.length > position) {\r
-          loginInfo.host = cmdLine.getArgument(position + 1);\r
-          cmdLine.removeArguments(position, position + 1);\r
-          loginInfoProvided = true;\r
-          continue;\r
+    var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]\r
+             .getService(Components.interfaces.nsIWindowMediator);\r
+    var targetWindow = wm.getMostRecentWindow(aWindowType);\r
+    if (targetWindow != null) {\r
+        var noFocus = false;\r
+        if(typeof targetWindow.new_tabs == 'function' && aArgument != null) {\r
+            targetWindow.new_tabs(aArgument);\r
+            noFocus = true;\r
         }\r
-        if (arg == '-ilsuser' && cmdLine.length > position) {\r
-          loginInfo.user = cmdLine.getArgument(position + 1);\r
-          cmdLine.removeArguments(position, position + 1);\r
-          loginInfoProvided = true;\r
-          continue;\r
+        if(typeof targetWindow.auto_login == 'function' && aLoginInfo != null) {\r
+            targetWindow.auto_login(aLoginInfo);\r
+            noFocus = true;\r
         }\r
-        if (arg == '-ilspassword' && cmdLine.length > position) {\r
-          loginInfo.passwd = cmdLine.getArgument(position + 1);\r
-          cmdLine.removeArguments(position, position + 1);\r
-          loginInfoProvided = true;\r
-          continue;\r
+        if(!noFocus) {\r
+            targetWindow.focus();\r
         }\r
-               position=position + 1;\r
-       }\r
-\r
-       if (cmdLine.handleFlag("ILSlogin", false) || inParams.length > 0 || loginInfoProvided) {\r
-         findOrOpenWindow(WINDOW_MAIN, XUL_MAIN, '_blank', inParams, loginInfoProvided ? loginInfo : null);\r
-         cmdLine.preventDefault = true;\r
-       }\r
-\r
-    if (cmdLine.handleFlag("ILSoffline", false) || cmdLine.handleFlag("ILSstandalone", false)) {\r
-         findOrOpenWindow(WINDOW_STANDALONE, XUL_STANDALONE, 'Offline', null, null);\r
-      cmdLine.preventDefault = true;\r
-       }\r
-  },\r
-\r
-  // CHANGEME: change the help info as appropriate, but\r
-  // follow the guidelines in nsICommandLineHandler.idl\r
-  // specifically, flag descriptions should start at\r
-  // character 24, and lines should be wrapped at\r
-  // 72 characters with embedded newlines,\r
-  // and finally, the string should end with a newline\r
-  helpInfo : "  -ILScheckin          Open an Evergreen checkin tab\n" +\r
-             "  -ILScheckout         Open an Evergreen checkout tab\n" +\r
-             "  -ILSnew              Open a new Evergreen 'menu' window\n" +\r
-             "  -ILSnew_default      Open a new Evergreen 'menu' window,\n" +\r
-             "                       with a 'default' tab\n" +\r
-             "  -ILStab              Open a 'default' tab alone\n" +\r
-             "  -ILSurl <url>        Open the specified url in an Evergreen tab\n" +\r
-             "  -ILShost             Default hostname for login\n" +\r
-             "  -ILSuser             Default username for login\n" +\r
-             "  -ILSpassword         Default password for login\n" +\r
-             "  The above three, if all specified, trigger an automatic login attempt\n" +\r
-             "  The above nine imply -ILSlogin\n" +\r
-             "  -ILSlogin            Open the Evergreen Login window\n" +\r
-             "  -ILSstandalone       Open the Evergreen Standalone interface\n" +\r
-             "  -ILSoffline          Alias for -ILSstandalone\n",\r
-\r
-  /* nsIFactory */\r
-\r
-  createInstance : function clh_CI(outer, iid)\r
-  {\r
-    if (outer != null)\r
-      throw Components.results.NS_ERROR_NO_AGGREGATION;\r
-\r
-    return this.QueryInterface(iid);\r
-  },\r
-\r
-  lockFactory : function clh_lock(lock)\r
-  {\r
-    /* no-op */\r
-  }\r
-};\r
-\r
-/**\r
- * The XPCOM glue that implements nsIModule\r
- */\r
-const myAppHandlerModule = {\r
-  /* nsISupports */\r
-  QueryInterface : function mod_QI(iid)\r
-  {\r
-    if (iid.equals(nsIModule) ||\r
-        iid.equals(nsISupports))\r
-      return this;\r
-\r
-    throw Components.results.NS_ERROR_NO_INTERFACE;\r
-  },\r
-\r
-  /* nsIModule */\r
-  getClassObject : function mod_gch(compMgr, cid, iid)\r
-  {\r
-    if (cid.equals(clh_CID))\r
-      return myAppHandler.QueryInterface(iid);\r
-\r
-    throw Components.results.NS_ERROR_NOT_REGISTERED;\r
-  },\r
-\r
-  registerSelf : function mod_regself(compMgr, fileSpec, location, type)\r
-  {\r
-    compMgr.QueryInterface(nsIComponentRegistrar);\r
-\r
-    compMgr.registerFactoryLocation(clh_CID,\r
-                                    "myAppHandler",\r
-                                    clh_contractID,\r
-                                    fileSpec,\r
-                                    location,\r
-                                    type);\r
-\r
-    var catMan = Components.classes["@mozilla.org/categorymanager;1"].\r
-      getService(nsICategoryManager);\r
-    catMan.addCategoryEntry("command-line-handler",\r
-                            clh_category,\r
-                            clh_contractID, true, true);\r
-  },\r
+    }\r
+    else {\r
+        var params = null;\r
+        if (aArgument != null && aArgument.length != 0 || aLoginInfo != null)\r
+        {\r
+            params = { "openTabs" : aArgument, "loginInfo" : aLoginInfo };\r
+            params.wrappedJSObject = params;\r
+        }\r
+        var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]\r
+                 .getService(Components.interfaces.nsIWindowWatcher);\r
+        ww.openWindow(null, aChromeURISpec, aName, "chrome,resizable,dialog=no", params);\r
+    }\r
+}\r
 \r
-  unregisterSelf : function mod_unreg(compMgr, location, type)\r
-  {\r
-    compMgr.QueryInterface(nsIComponentRegistrar);\r
-    compMgr.unregisterFactoryLocation(clh_CID, location);\r
+function oilsCommandLineHandler() {}\r
+oilsCommandLineHandler.prototype = {\r
+    classDescription: "OpenILS Command Line Handler",\r
+    classID:          Components.ID("{7e608198-7355-483a-a85a-20322e4ef91a}"),\r
+    contractID:       "@mozilla.org/commandlinehandler/general-startup;1?type=egcli",\r
+    _xpcom_categories: [{\r
+        category: "command-line-handler",\r
+        entry: "m-egcli"\r
+    }],\r
+    QueryInterface:   XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),\r
+    handle : function clh_handle(cmdLine) {\r
+        // Each of these options is used for opening a new tab, either on login or remote send.\r
+        // XULRunner does some sanitize to turn /ilsblah into -ilsblah, for example.\r
+        // In addition to the ones here:\r
+        // -ilslogin, -ilsoffline, -ilsstandalone, -ilshost, -ilsuser, and -ilspassword\r
+        // are defined below.\r
+\r
+        // With the exception of 'new', 'tab', and 'init', the value is checked for in urls in main.js.\r
+\r
+        // NOTE: The option itself should be all lowercase (we .toLowerCase below)\r
+        var options = {\r
+            '-ilscheckin' : 'XUL_CHECKIN',\r
+            '-ilscheckout' : 'XUL_PATRON_BARCODE_ENTRY',\r
+            '-ilsnew' : 'new', // 'new' is a special keyword for opening a new window\r
+            '-ilstab' : 'tab', // 'tab' is a special keyword for opening a new tab with the default content\r
+            '-ilsnew_default' : 'init', // 'init' is a special keyword for opening a new window with an initial default tab\r
+        };\r
+\r
+        var inParams = new Array();\r
+        var loginInfo = {};\r
+        var loginInfoProvided = false;\r
+        var position = 0;\r
+        while (position < cmdLine.length) {\r
+            var arg = cmdLine.getArgument(position).toLowerCase();\r
+            if (options[arg] != undefined) {\r
+                inParams.push(options[arg]);\r
+                cmdLine.removeArguments(position,position);\r
+                continue;\r
+            }\r
+            if (arg == '-ilsurl' && cmdLine.length > position) {\r
+                inParams.push(cmdLine.getArgument(position + 1));\r
+                cmdLine.removeArguments(position, position + 1);\r
+                continue;\r
+            }\r
+            if (arg == '-ilshost' && cmdLine.length > position) {\r
+                loginInfo.host = cmdLine.getArgument(position + 1);\r
+                cmdLine.removeArguments(position, position + 1);\r
+                loginInfoProvided = true;\r
+                continue;\r
+            }\r
+            if (arg == '-ilsuser' && cmdLine.length > position) {\r
+                loginInfo.user = cmdLine.getArgument(position + 1);\r
+                cmdLine.removeArguments(position, position + 1);\r
+                loginInfoProvided = true;\r
+                continue;\r
+            }\r
+            if (arg == '-ilspassword' && cmdLine.length > position) {\r
+                loginInfo.passwd = cmdLine.getArgument(position + 1);\r
+                cmdLine.removeArguments(position, position + 1);\r
+                loginInfoProvided = true;\r
+                continue;\r
+            }\r
+            position=position + 1;\r
+        }\r
 \r
-    var catMan = Components.classes["@mozilla.org/categorymanager;1"].\r
-      getService(nsICategoryManager);\r
-    catMan.deleteCategoryEntry("command-line-handler", clh_category);\r
-  },\r
+        if (cmdLine.handleFlag("ILSlogin", false) || inParams.length > 0 || loginInfoProvided) {\r
+            findOrOpenWindow(WINDOW_MAIN, XUL_MAIN, '_blank', inParams, loginInfoProvided ? loginInfo : null);\r
+            cmdLine.preventDefault = true;\r
+        }\r
 \r
-  canUnload : function (compMgr)\r
-  {\r
-    return true;\r
-  }\r
+        if (cmdLine.handleFlag("ILSoffline", false) || cmdLine.handleFlag("ILSstandalone", false)) {\r
+            findOrOpenWindow(WINDOW_STANDALONE, XUL_STANDALONE, 'Offline', null, null);\r
+            cmdLine.preventDefault = true;\r
+        }\r
+    },\r
+\r
+    // Help Info:\r
+    // Flag descriptions start on char 24\r
+    // 72 char wrap on lines, embedded newlines\r
+    // End with a newline\r
+    helpInfo : "  -ILScheckin          Open an Evergreen checkin tab\n" +\r
+               "  -ILScheckout         Open an Evergreen checkout tab\n" +\r
+               "  -ILSnew              Open a new Evergreen 'menu' window\n" +\r
+               "  -ILSnew_default      Open a new Evergreen 'menu' window,\n" +\r
+               "                       with a 'default' tab\n" +\r
+               "  -ILStab              Open a 'default' tab alone\n" +\r
+               "  -ILSurl <url>        Open the specified url in an Evergreen tab\n" +\r
+               "  -ILShost             Default hostname for login\n" +\r
+               "  -ILSuser             Default username for login\n" +\r
+               "  -ILSpassword         Default password for login\n" +\r
+               "  The above three, if all specified, trigger an automatic login attempt\n" +\r
+               "  The above nine imply -ILSlogin\n" +\r
+               "  -ILSlogin            Open the Evergreen Login window\n" +\r
+               "  -ILSstandalone       Open the Evergreen Standalone interface\n" +\r
+               "  -ILSoffline          Alias for -ILSstandalone\n",\r
 };\r
 \r
-/* The NSGetModule function is the magic entry point that XPCOM uses to find what XPCOM objects\r
- * this component provides\r
- */\r
-function NSGetModule(comMgr, fileSpec)\r
-{\r
-  return myAppHandlerModule;\r
-}\r
+if (XPCOMUtils.generateNSGetFactory)\r
+    var NSGetFactory = XPCOMUtils.generateNSGetFactory([oilsCommandLineHandler]);\r
+else\r
+    var NSGetModule = XPCOMUtils.generateNSGetModule([oilsCommandLineHandler]);\r
 \r
index d93aaca..ff0ac5f 100644 (file)
@@ -1,30 +1,26 @@
-const nsISupports           = Components.interfaces.nsISupports;
-const nsICategoryManager    = Components.interfaces.nsICategoryManager;
-const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
-const nsIContentPolicy      = Components.interfaces.nsIContentPolicy;
-const nsIFactory            = Components.interfaces.nsIFactory;
-const nsIModule             = Components.interfaces.nsIModule;
-const nsIWindowWatcher      = Components.interfaces.nsIWindowWatcher;
-
-const WINDOW_MAIN = "eg_main"
-
-const fe_contractID = "@mozilla.org/content-policy;1?type=egfe";
-const fe_CID = Components.ID("{D969ED61-DF4C-FA12-A2A6-70AA94C222FB}");
-// category names are sorted alphabetically. Typical command-line handlers use a
-// category that begins with the letter "m".
-const fe_category = "m-egfe";
-
-const myAppHandler = {
-
-   shouldLoad: function(contentType, contentLocation, requestOrigin, node, mimeTypeGuess, extra)
-   {
-      if (contentType == nsIContentPolicy.TYPE_DOCUMENT) {
-          var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
-            getService(Components.interfaces.nsIWindowMediator);
-          var targetWindow = wm.getMostRecentWindow("eg_main");
-          if (targetWindow != null) {
-            var host = targetWindow.G.data.server_unadorned;
-            if(host && (contentLocation.scheme == 'http' || contentLocation.scheme == 'https') && contentLocation.host != host) {
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
+// This content policy component tries to prevent outside sites from getting xulG hooks
+// It does so by forcing them to open outside of Evergreen
+
+function oilsForceExternal() {}
+oilsForceExternal.prototype = {
+    classDescription: "OpenILS Force External",
+    classID:          Components.ID("{D969ED61-DF4C-FA12-A2A6-70AA94C222FB}"),
+    contractID:       "@mozilla.org/content-policy;1?type=egfe",
+    _xpcom_categories: [{
+        category: "content-policy",
+        entry: "m-egfe"
+    }],
+    QueryInterface:   XPCOMUtils.generateQI([Components.interfaces.nsIContentPolicy]),
+    shouldLoad: function(contentType, contentLocation, requestOrigin, node, mimeTypeGuess, extra)
+    {
+        if ((contentType == Components.interfaces.nsIContentPolicy.TYPE_DOCUMENT || contentType == Components.interfaces.nsIContentPolicy.TYPE_SUBDOCUMENT)
+          && (contentLocation.scheme == 'http' || contentLocation.scheme == 'https')
+          && node && node.getAttribute('oils_force_external') == 'true') {
+            var data_cache = Components.classes["@open-ils.org/openils_data_cache;1"].getService().wrappedJSObject.data;
+            var host = data_cache.server_unadorned;
+            if(host && contentLocation.host != host) {
                 // first construct an nsIURI object using the ioservice
                 var ioservice = Components.classes["@mozilla.org/network/io-service;1"]
                                 .getService(Components.interfaces.nsIIOService);
@@ -32,112 +28,25 @@ const myAppHandler = {
                 var uriToOpen = ioservice.newURI(contentLocation.spec, null, null);
 
                 var extps = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
-                                .getService(Components.interfaces.nsIExternalProtocolService);
+                            .getService(Components.interfaces.nsIExternalProtocolService);
 
                 // now, open it!
                 extps.loadURI(uriToOpen, null);
 
-                return nsIContentPolicy.REJECT_REQUEST;
+                return Components.interfaces.nsIContentPolicy.REJECT_REQUEST;
             }
-          }
-      }
-      return nsIContentPolicy.ACCEPT;
-   },
-
-   shouldProcess: function(contentType, contentLocation, requestOrigin, insecNode, mimeType, extra)
-   {
-      return nsIContentPolicy.ACCEPT;
-   },
-
-  /* nsISupports */
-  QueryInterface : function fe_QI(iid)
-  {
-    if (iid.equals(nsIContentPolicy) ||
-        iid.equals(nsIFactory) ||
-        iid.equals(nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  },
-
-  /* nsIFactory */
-
-  createInstance : function fe_CI(outer, iid)
-  {
-    if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-
-    return this.QueryInterface(iid);
-  },
-
-  lockFactory : function fe_lock(lock)
-  {
-    /* no-op */
-  }
-};
-
-/**
- * The XPCOM glue that implements nsIModule
- */
-const myAppHandlerModule = {
-  /* nsISupports */
-  QueryInterface : function mod_QI(iid)
-  {
-    if (iid.equals(nsIModule) ||
-        iid.equals(nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  },
-
-  /* nsIModule */
-  getClassObject : function mod_gch(compMgr, cid, iid)
-  {
-    if (cid.equals(fe_CID))
-      return myAppHandler.QueryInterface(iid);
-
-    throw Components.results.NS_ERROR_NOT_REGISTERED;
-  },
-
-  registerSelf : function mod_regself(compMgr, fileSpec, location, type)
-  {
-    compMgr.QueryInterface(nsIComponentRegistrar);
-
-    compMgr.registerFactoryLocation(fe_CID,
-                                    "myAppHandler",
-                                    fe_contractID,
-                                    fileSpec,
-                                    location,
-                                    type);
-
-    var catMan = Components.classes["@mozilla.org/categorymanager;1"].
-      getService(nsICategoryManager);
-    catMan.addCategoryEntry("content-policy",
-                            fe_category,
-                            fe_contractID, true, true);
-  },
-
-  unregisterSelf : function mod_unreg(compMgr, location, type)
-  {
-    compMgr.QueryInterface(nsIComponentRegistrar);
-    compMgr.unregisterFactoryLocation(fe_CID, location);
-
-    var catMan = Components.classes["@mozilla.org/categorymanager;1"].
-      getService(nsICategoryManager);
-    catMan.deleteCategoryEntry("content-policy", fe_category);
-  },
-
-  canUnload : function (compMgr)
-  {
-    return true;
-  }
+        }
+        return Components.interfaces.nsIContentPolicy.ACCEPT;
+    },
+
+    shouldProcess: function(contentType, contentLocation, requestOrigin, insecNode, mimeType, extra)
+    {
+        return Components.interfaces.nsIContentPolicy.ACCEPT;
+    },
 };
 
-/* The NSGetModule function is the magic entry point that XPCOM uses to find what XPCOM objects
- * this component provides
- */
-function NSGetModule(comMgr, fileSpec)
-{
-  return myAppHandlerModule;
-}
+if (XPCOMUtils.generateNSGetFactory)
+    var NSGetFactory = XPCOMUtils.generateNSGetFactory([oilsForceExternal]);
+else
+    var NSGetModule = XPCOMUtils.generateNSGetModule([oilsForceExternal]);
 
diff --git a/Open-ILS/xul/staff_client/components/inspector-cmdline.js b/Open-ILS/xul/staff_client/components/inspector-cmdline.js
deleted file mode 100644 (file)
index badf36a..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is DOM Inspector.
- *
- * The Initial Developer of the Original Code is
- * Christopher A. Aillon <christopher@aillon.com>.
- * Portions created by the Initial Developer are Copyright (C) 2003
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Christopher A. Aillon <christopher@aillon.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-// NOTE: this file implements both the seamonkey nsICmdLineHandler and
-// the toolkit nsICommandLineHandler, using runtime detection.
-
-const INSPECTOR_CMDLINE_CONTRACTID = "@mozilla.org/commandlinehandler/general-startup;1?type=inspector";
-const INSPECTOR_CMDLINE_CLSID      = Components.ID('{38293526-6b13-4d4f-a075-71939435b408}');
-const CATMAN_CONTRACTID            = "@mozilla.org/categorymanager;1";
-const nsISupports                  = Components.interfaces.nsISupports;
-
-const nsICategoryManager           = Components.interfaces.nsICategoryManager;
-const nsICmdLineHandler            = Components.interfaces.nsICmdLineHandler;
-const nsICommandLine               = Components.interfaces.nsICommandLine;
-const nsICommandLineHandler        = Components.interfaces.nsICommandLineHandler;
-const nsIComponentRegistrar        = Components.interfaces.nsIComponentRegistrar;
-const nsISupportsString            = Components.interfaces.nsISupportsString;
-const nsIWindowWatcher             = Components.interfaces.nsIWindowWatcher;
-
-function InspectorCmdLineHandler() {}
-InspectorCmdLineHandler.prototype =
-{
-  /* nsISupports */
-  QueryInterface : function handler_QI(iid) {
-    if (iid.equals(nsISupports))
-      return this;
-
-    if (nsICmdLineHandler && iid.equals(nsICmdLineHandler))
-      return this;
-
-    if (nsICommandLineHandler && iid.equals(nsICommandLineHandler))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  },
-
-  /* nsICmdLineHandler */
-  commandLineArgument : "-inspector",
-  prefNameForStartup : "general.startup.inspector",
-  chromeUrlForTask : "chrome://inspector/content/inspector.xul",
-  helpText : "Start with the DOM Inspector.",
-  handlesArgs : true,
-  defaultArgs : "",
-  openWindowWithArgs : true,
-
-  /* nsICommandLineHandler */
-  handle : function handler_handle(cmdLine) {
-    var args = Components.classes["@mozilla.org/supports-string;1"]
-                         .createInstance(nsISupportsString);
-    try {
-      var uristr = cmdLine.handleFlagWithParam("inspector", false);
-      if (uristr == null)
-        return;
-      try {
-        args.data = cmdLine.resolveURI(uristr).spec;
-      }
-      catch (e) {
-        return;
-      }
-    }
-    catch (e) {
-      cmdLine.handleFlag("inspector", true);
-    }
-
-    var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
-                           .getService(nsIWindowWatcher);
-    wwatch.openWindow(null, "chrome://inspector/content/", "_blank",
-                      "chrome,dialog=no,all", args);
-    cmdLine.preventDefault = true;
-  },
-
-  helpInfo : "  -inspector <url>     Open the DOM inspector.\n"
-};
-
-
-var InspectorCmdLineFactory =
-{
-  createInstance : function(outer, iid)
-  {
-    if (outer != null) {
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    }
-
-    return new InspectorCmdLineHandler().QueryInterface(iid);
-  }
-};
-
-
-var InspectorCmdLineModule =
-{
-  registerSelf : function(compMgr, fileSpec, location, type)
-  {
-    compMgr = compMgr.QueryInterface(nsIComponentRegistrar);
-
-    compMgr.registerFactoryLocation(INSPECTOR_CMDLINE_CLSID,
-                                    "DOM Inspector CommandLine Service",
-                                    INSPECTOR_CMDLINE_CONTRACTID,
-                                    fileSpec,
-                                    location,
-                                    type);
-
-    var catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager);
-    catman.addCategoryEntry("command-line-argument-handlers",
-                            "inspector command line handler",
-                            INSPECTOR_CMDLINE_CONTRACTID, true, true);
-    catman.addCategoryEntry("command-line-handler",
-                            "m-inspector",
-                            INSPECTOR_CMDLINE_CONTRACTID, true, true);
-  },
-
-  unregisterSelf : function(compMgr, fileSpec, location)
-  {
-    compMgr = compMgr.QueryInterface(nsIComponentRegistrar);
-
-    compMgr.unregisterFactoryLocation(INSPECTOR_CMDLINE_CLSID, fileSpec);
-    catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager);
-    catman.deleteCategoryEntry("command-line-argument-handlers",
-                               "inspector command line handler", true);
-    catman.deleteCategoryEntry("command-line-handler",
-                               "m-inspector", true);
-  },
-
-  getClassObject : function(compMgr, cid, iid)
-  {
-    if (cid.equals(INSPECTOR_CMDLINE_CLSID)) {
-      return InspectorCmdLineFactory;
-    }
-
-    if (!iid.equals(Components.interfaces.nsIFactory)) {