Last Comment Bug 562646 - Bespin embedded 0.7.1 does not work inside xulrunner-based apps because of localStorage
: Bespin embedded 0.7.1 does not work inside xulrunner-based apps because of lo...
Status: RESOLVED FIXED
:
Product: Skywriter
Classification: Graveyard
Component: Embedded (show other bugs)
: Trunk
: All All
: -- critical (vote)
: 0.8
Assigned To: Julian Viereck
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-29 06:02 PDT by Daniel Glazman (:glazou)
Modified: 2010-06-01 09:37 PDT (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Daniel Glazman (:glazou) 2010-04-29 06:02:50 PDT
Bespin Embedded 0.7.1 calls window.localStorage and window.localStorage.history,
and those are not available from an <iframe> or <browser> xul tag inside a
xulrunner-based application... So 0.7.1 is for the time being unusable with
xulrunner :-(

LocalStorage is (seen from here) used for user settings and history of edited
documents, all things that are irrelevant in the case of the embedded Bespin and
should be moved outside of BespinEmbedded.js, preserving the client-server tool
and allowing the embedded version to work again with XR.
Comment 1 Panos Astithas [:past] 2010-04-29 06:26:20 PDT
It also happens when using an HTML file instead of a XUL file for your UI in a xulrunner app. The error can be observed by installing my despin plugin:

http://github.com/past/despin
Comment 2 Kevin Dangoor 2010-04-29 12:27:21 PDT
Unfortunately, given the changes that this would require and where we're at with releases, a fix for this is likely not going to land in 0.7.x and will have to wait for the "Theora" release of Bespin.
Comment 3 satyr 2010-04-29 17:41:32 PDT
Workarounded this by using resource: URL instead of chrome:.

https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/2ce34b3fc51c
Comment 4 Panos Astithas [:past] 2010-04-30 00:39:11 PDT
Sadly this didn't work for me, albeit using gBrowser.addTab:

-    var newTab = gBrowser.addTab('chrome://despin/content/editor.html');
+    var newTab = gBrowser.addTab('resource://despin/content/editor.html');
Comment 5 Daniel Glazman (:glazou) 2010-04-30 02:09:18 PDT
(In reply to comment #3)

> Workarounded this by using resource: URL instead of chrome:.
> 
> https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/2ce34b3fc51c

Satyr, you just made my day !!! I confirm this work around works, see
http://pikchur.com/QWv

Kevin, you should probably document this workaround somewhere in the doc pages.
Comment 6 Kevin Dangoor 2010-05-26 07:33:55 PDT
If I recall correctly, the localStorage reference that was causing this problem was in SproutCore. This is likely not a problem now. (I don't know if jQuery has any trouble running in XULRunner... that would be good to know.)
Comment 7 Julian Viereck 2010-06-01 09:37:53 PDT
As with changeset a0d37bb62076, the fileHistory is now in a separate plugin. 
That means, if you don't inlcude the "file_history" plugin when building the 
embedded release, you shouldn't have problems with the localStorage anymore. I 
also added some more tests to make sure that the localStorage object is not 
accessed if it's not around.

Due to these changes, I mark this bug as fixed.

Note You need to log in before you can comment on or make changes to this bug.