Thaks for the tip, I figured out the problem supportsGlobal sholud declare in debugger object:
-------------------------------------------------------- <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/ gatekeeper/there.is.only.xul"> <script type="text/javascript"> <![CDATA[ var db = { init: function() { this.wrappedJSObject = this; }, supportsGlobal: function(global) { var context = window.parent; this.breakContext = context; return !!context; }, resume: function() { delete context; fbs.exitNestedEventLoop(); dump('resume\n') }, onJSDActivate: function(jsd) { alert('onJSDActivate'); }, onJSDDeactivate: function(jsd) { alert('onJSDDeactivate'); }, onStop: function(context, frame, type, rv) { }, onBreak: function(context, frame, type, rv) { dump('onBreak\n'); fbs.enterNestedEventLoop({onNest: function(){ dump('onNest\n'); }}); }, onResume: function(context) { alert('onResume') }, onThrow: function(context, frame, rv) { }, onError: function(context, frame, error) { alert(error); }, onEventScriptCreated: function(context, frame, url) { }, onTopLevelScriptCreated: function(context, frame, url) { }, onEvalScriptCreated: function(context, frame, url) { }, onFunctionConstructor: function(context, frame, ctor_script, url) { }, }; netscape.security.PrivilegeManager.enablePrivilege ('UniversalXPConnect'); My_debugger = db; My_debugger.init(); var fbs = Components.classes["@joehewitt.com/firebug;1"].getService ().wrappedJSObject; fbs.registerClient(My_debugger); fbs.registerDebugger(My_debugger); ]]> </script> <label value="execute" onclick="debugger;alert('p')"/> <label value="resume" onclick="My_debugger.resume()"/> </window> -------------------------------------------------------- now when I press execute label, onBreak fires Can you please tell me how to resume code, when I press My_debugger.resume() nothing happens, maybe something else must done before fbs.exitNestedEventLoop(); fires -Joe On Mar 17, 7:01 pm, johnjbarton <[email protected]> wrote: > My suggestion is to set FBTrace.DBG_FBS_FINDDEBUGGER true and verify > that the trace shows the registration. > > jjb > > On Mar 16, 11:46 pm, Joe <[email protected]> wrote: > > > > > I did a test,put alert in onJSDActivate too,: > > onJSDActivate: function(jsd) { alert('onJSDActivate'); }, > > but it didnt show alert, > > > about prefs, firebug extension is on my current firefox profile so all > > prefs have correct value: > > extensions.firebug-service.showStackTrace = true,... > > > also I add this line too: > > netscape.security.PrivilegeManager.enablePrivilege > > ('UniversalXPConnect'); > > > So whole code looks like this: > > -------------------------------------------------------- > > <?xml version="1.0"?> > > <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> > > <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/ > > gatekeeper/there.is.only.xul"> > > > <script type="text/javascript"> > > <![CDATA[ > > var db = { > > init: function() { > > this.wrappedJSObject = this; > > }, > > onJSDActivate: function(jsd) { alert('onJSDActivate'); }, > > onJSDDeactivate: function(jsd) { alert('onJSDDeactivate'); }, > > onStop: function(context, frame, type, rv) {}, > > onResume: function(context) { }, > > onThrow: function(context, frame, rv) { }, > > onError: function(context, frame, error) { alert('error'); }, > > onEventScriptCreated: function(context, frame, url) { }, > > onTopLevelScriptCreated: function(context, frame, url) { }, > > onEvalScriptCreated: function(context, frame, url) { }, > > onFunctionConstructor: function(context, frame, ctor_script, url) > > { },}; > > > netscape.security.PrivilegeManager.enablePrivilege > > ('UniversalXPConnect'); > > My_debugger = db; > > My_debugger.init(); > > var fbs = Components.classes["@joehewitt.com/firebug;1"].getService > > ().wrappedJSObject; > > fbs.registerClient(My_debugger); > > fbs.registerDebugger(My_debugger); > > ]]> > > </script> > > <label value="Put your XUL here!" onclick="eval(alert(o))"/> > > </window> > > -------------------------------------------------------- > > > It seems that I am missing something there so non of the debugger > > object functions are called > > Do you have any idea how can I solve the problem? > > > TNX > > Joe > > > On Mar 17, 7:43 am, johnjbarton <[email protected]> wrote: > > > > I don't know, you're the first person to ever try this. Plus I don't > > > know what you mean by "it works". You asked about onError, that > > > should be the only pref for it. The other prefs should not affect you. > > > I'd run with FBTrace.DBG_FBS_ERRORS on, plus DBG_FINDDEBUGGER. But > > > that assumes FBTrace is working... > > > > jjb > > > > On Mar 16, 9:18 pm, Joe <[email protected]> wrote: > > > > > Ok > > > > > But I think I should activate more prefs too [https://poss.its.ac.id/ > > > > scm/viewvc.php/*checkout*/HaniF%20project/kode/HANIF/extensions/firebug > > > > %40software.joehewitt.com/defaults/preferences/firebug.js? > > > > root=hanif&revision=4&content-type=text%2Fplain&pathrev=4] > > > > > Can you please give me a minimum list of prefs which should be set > > > > before it works? > > > > > On Mar 17, 4:13 am, johnjbarton <[email protected]> wrote: > > > > > > because debugger.onError() is only called when jsd.onDebug is > > > > > triggered, and that happens, for example, when you set > > > > > preference, extensions.firebug-service.showStackTrace true > > > > > > The reason is that jsd.onError does not provide a stack and providing > > > > > the stack via onDebug costs some time, so I made it an option, > > > > > allowing users to avoid the overhead. > > > > > > jjb > > > > > > On Mar 16, 4:56 pm, Joe <[email protected]> wrote: > > > > > > > Ok > > > > > > > so why I dont get error in: > > > > > > onError: function(context, frame, error) { alert('error'); }, > > > > > > when there is a error in xul like this: > > > > > > <label value="Press me!" onclick="eval(alert(o))"/> //Error: o is > > > > > > not > > > > > > defined > > > > > > > Here is my complete code: > > > > > > <?xml version="1.0"?> > > > > > > <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> > > > > > > <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/ > > > > > > gatekeeper/there.is.only.xul"> > > > > > > > <script type="text/javascript"> > > > > > > <![CDATA[ > > > > > > var db = { > > > > > > init: function() { > > > > > > this.wrappedJSObject = this; > > > > > > }, > > > > > > onJSDActivate: function(jsd) { }, > > > > > > onJSDDeactivate: function(jsd) { }, > > > > > > onStop: function(context, frame, type, rv) { }, > > > > > > onResume: function(context) { }, > > > > > > onThrow: function(context, frame, rv) { }, > > > > > > onError: function(context, frame, error) { alert('error'); }, > > > > > > onEventScriptCreated: function(context, frame, url) { }, > > > > > > onTopLevelScriptCreated: function(context, frame, url) { }, > > > > > > onEvalScriptCreated: function(context, frame, url) { }, > > > > > > onFunctionConstructor: function(context, frame, ctor_script, > > > > > > url) > > > > > > { },}; > > > > > > > My_debugger = db; > > > > > > My_debugger.init(); > > > > > > var fbs = Components.classes["@joehewitt.com/firebug;1"].getService > > > > > > ().wrappedJSObject; > > > > > > fbs.registerClient(My_debugger); > > > > > > fbs.registerDebugger(My_debugger); > > > > > > ]]> > > > > > > </script> > > > > > > <label value="Put your XUL here!" onclick="eval(alert(o))"/> > > > > > > </window> > > > > > > > On Mar 17, 2:12 am, johnjbarton <[email protected]> wrote: > > > > > > > > yea, something like that. > > > > > > > > On Mar 16, 3:13 pm, Joe <[email protected]> wrote: > > > > > > > > > Sorry but I dont get the idea, do you mean something like this: > > > > > > > > > //supply a 'debugger' object > > > > > > > > var db = { > > > > > > > > init: function() { > > > > > > > > this.wrappedJSObject = this; > > > > > > > > }, > > > > > > > > onJSDActivate: function(jsd) { }, > > > > > > > > onJSDDeactivate: function(jsd) { }, > > > > > > > > onStop: function(context, frame, type, rv) { }, > > > > > > > > onResume: function(context) { }, > > > > > > > > onThrow: function(context, frame, rv) { }, > > > > > > > > onError: function(context, frame, error) { alert('error'); > > > > > > > > }, > > > > > > > > onEventScriptCreated: function(context, frame, url) { }, > > > > > > > > onTopLevelScriptCreated: function(context, frame, url) { }, > > > > > > > > onEvalScriptCreated: function(context, frame, url) { }, > > > > > > > > onFunctionConstructor: function(context, frame, > > > > > > > > ctor_script, url) > > > > > > > > { }, > > > > > > > > > }; > > > > > > > > > My_debugger = db; > > > > > > > > My_debugger.init(); > > > > > > > > var fbs = > > > > > > > > Components.classes["@joehewitt.com/firebug;1"].getService > > > > > > > > ().wrappedJSObject; > > > > > > > > fbs.registerClient(My_debugger); > > > > > > > > fbs.registerDebugger(My_debugger); > > > > > > > > > On Mar 17, 12:00 am, johnjbarton <[email protected]> > > > > > > > > wrote: > > > > > > > > > > No, you don't redefine fbs functions, but rather you supply a > > > > > > > > > 'debugger' object that implements call back functions for the > > > > > > > > > debug > > > > > > > > > events. > > > > > > > > > See debugger.js > > > > > > > > > ....fbs.registerClient(this); // once per XUL window, tells > > > > > > > > > you when > > > > > > > > > jsd turns on/off > > > > > > > > > ..... fbs.registerDebugger(this); // when you are ready for > > > > > > > > > callbacks > > > > > > > > > > jjb > > > > > > > > > > On Mar 16, 11:11 am, Joe <[email protected]> wrote: > > > > > > > > > > > OK, Thanks for reply > > > > > > > > > > I try to add fsb to my extension: > > > > > > > > > > > var fbs = Components.classes["@joehewitt.com/firebug;1"] > > > > > > > > > > .getService().wrappedJSObject; > > > > > > > > > > > fbs.onError: function(frame, error) { > > > > > > > > > > dump('error'); > > > > > > > > > > > } > > > > > > > > > > > Is it ok to get error ? Am I missing something, for example > > > > > > > > > > how to > > > > > > > > > > initialize,... > > > > > > > > > > > On Mar 16, 5:25 pm, johnjbarton > > > > > > > > > > <[email protected]> wrote: > > > > > > > > > > > > Sure its possible, that's what Firebug does. If you look > > > > > > > > > > > at the code > > > > > > > > > > > for 'debugger.js' you can control firebug-service the way > > > > > > > > > > > it does. > > > > > > > > > > > > jjb > > > > > > > > > > > > On Mar 16, 2:21 am, Joe <[email protected]> wrote: > > > > > > > > > > > > > Hi > > > > > > > > > > > > > Is it possible to add firebug-service.js to > > > > > > > > > > > > chrome://component folder > > > > > > > > > > > > of extension and use it as a debugger > > > > > > > > > > > > > I want to stop some code at "debugger;" keyword then > > > > > > > > > > > > put a button to > > > > > > > > > > > > resume it > > > > > > > > > > > > > Any help would be appreciated- Hide quoted text - > > > > > > > > > > > > - Show quoted text -- Hide quoted text - > > > > > > > > > > - Show quoted text -- Hide quoted text - > > > > > > > > - Show quoted text -- Hide quoted text - > > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Firebug" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/firebug?hl=en -~----------~----~----~----~------~----~------~--~---
