I'm still trying to track down why the firebase @require script loaded 
through greasemonkey might not be working.  I posted on the firebase forum 
and they recommended enabling firebase logging.  It came back with this:

p:0: Browser went online.  Reconnecting.  
>
> firebase.js (line 38)
>
> p:0: Listen called for /mine default  
>
> firebase.js (line 38)
>
> 0: set {"path":"/mine/-JnXUZccp15pvFDjYXMX","value":{"title":"Hello 
> World!","author":"Firebase","location":{"city":"San 
> Francisco","state":"California","zip":94103}},"Ug":null}  
>
> firebase.js (line 38)
>
> p:0: Buffering put: /mine/-JnXUZccp15pvFDjYXMX  
>
> firebase.js (line 38)
> event: /mine:child_added:{"author":"Firebase","location":{"city":"San 
> Francisco","state":"California","zip":94103},"title":"Hello World!"} 
> firebase.js (line 38)
> Object { author="Firebase",  location={...},  title="Hello World!"}
> indexCa...user.js (line 15)
> pushed Hello World
> indexCa...user.js (line 29)
>
> 0: set {"path":"/mine/-JnXUZcn9gOQJd4w-TmM","value":{"title":"dude 
> World!","author":"Firebase2","location":{"city":"San 
> Franciscos","state":"Californiaaaa","zip":94103}},"Ug":null}  
>
> firebase.js (line 38)
>
> p:0: Buffering put: /mine/-JnXUZcn9gOQJd4w-TmM  
>
> firebase.js (line 38)
> event: /mine:child_added:{"author":"Firebase2","location":{"city":"San 
> Franciscos","state":"Californiaaaa","zip":94103},"title":"dude World!"} 
> firebase.js (line 38)
> Object { author="Firebase2",  location={...},  title="dude World!"}
> indexCa...user.js (line 15)
> pushed dude World
> indexCa...user.js (line 40)
>
> p:0: Making a connection attempt  
>
> firebase.js (line 38)
>
> c:0:0: Connection created  
>
> firebase.js (line 38)
> frame writing exception 
> firebase.js (line 38)
>
> Wg@file:///C:/Users/xxx/AppData/Roaming/Mozilla/Firefox/Profiles/mhxxxjy.default/gm_scripts/indexCache/firebase.js:166:292
> Tg.prototype.open/<@file:///C:/Users/xxx/AppData/Roaming/Mozilla/Firefox/Profiles/mxxxxjy.default/gm_scripts/indexCache/firebase.js:160:222
> Tc/c@file:///C:/Users/xxx/AppData/Roaming/Mozilla/Firefox/Profiles/mxxxjy.default/gm_scripts/indexCache/firebase.js:42:105
>  
>
> firebase.js (line 38)
> {} 
> firebase.js (line 38)
>
> c:0:0:0 Connecting via long-poll to 
> https://xxxxxxxx.firebaseio.com/.lp?start=t&ser=67812856&cb=1&v=5  
>
> firebase.js (line 38)
>
>
>
>
>
> c:0:0:0 Timed out trying to connect.  
>
> firebase.js (line 38)
>
> c:0:0:0 Longpoll is closing itself  
>
> firebase.js (line 38)
>
> c:0:0: Realtime connection failed.  
>
> firebase.js (line 38)
>
> c:0:0: Closing realtime connection.  
>
> firebase.js (line 38)
>
> c:0:0: Shutting down all connections  
>
> firebase.js (line 38)
>
> p:0: data client disconnected  
>
> firebase.js (line 38)
>
> p:0: Trying to reconnect in 0ms  
>
> firebase.js (line 38)
>
> 0: onDisconnectEvents  
>
> firebase.js (line 38)
>

One person's summary was this:

> Cool.  That confirms that:


>    1. You aren't able to connect to Firebase.
>    2. For some reason, WebSockets aren't available so we're trying to use 
>    long-polling.
>    3. Long-polling is failing (which could be for any number of reasons).
>
> Best bet would be to figure out why WebSockets don't work and fix that... 
>  but I don't know enough about GreaseMonkey to know how hard that is.
>

I've been poking at the code with little success.  I haven't narrowed down 
the issue, but for posterity's sake, I thought I'd make sure it was 
documented here in case someone might want to info regarding the topic.



On Tuesday, April 7, 2015 at 2:57:05 PM UTC-5, Ben Hest wrote:
>
> I'm trying to see if I can get Firebase working inside a greasemonkey 
> script, but am unable to get it to work.  
>
>    - It worked a-ok inside of tampermonkey.  
>    - It worked fine in a stand alone HTML doc after embedding the 
>    firebase script and the subesequent code
>    - But in Firefox 37.0.1 and GM 3.1 it any changes are not reflected in 
>    the Firebase dashboard and I cannot discern any overt errors through the 
>    javascript console.
>
> I know it's kind of a stretch asking here, but someone smarter than I 
> might have some idea.
>
> Thanks,
> Ben
>
> // ==UserScript==
> // @name        indexCache
> // @namespace   indexCache
> // @include     http://www.SOMEWEBSITE.com/en
> // @require     https://cdn.firebase.com/js/client/2.2.3/firebase.js
> // @version     1
> // @grant       none
> // ==/UserScript==
>
>
> var ref = new Firebase("https://SOMEFIREBASE.firebaseio.com/mine";);
>
> ref.on("child_added", function(snapshot) {
>   console.log(snapshot.val());
> }, function (errorObject) {
>   console.log("The read failed: " + errorObject.code);
> });
>
> ref.push({
>   title: "Hello World!",
>   author: "Firebase",
>   location: {
>     city: "San Francisco",
>     state: "California",
>     zip: 94103
>   }
> });
> console.log('pushed Hello World')
>
> ref.push({
>   title: "dude World!",
>   author: "Firebase2",
>   location: {
>     city: "San Franciscos",
>     state: "Californiaaaa",
>     zip: 94103
>   }
> });
> console.log('pushed dude World')
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to