0

I'm using Firefox developer edition, trying to debug a page (html+javascript) in a frame. With Firefox 33, in the debugger section I can see the source code of the page inside the frame, activate breakpoints...

My problem with developer edition is that it doesn't show the html code of the page, although it is selected in the left side of the toolbar. It shows some html code, but it's not from the selected page. I can't locate where is it from.

Is there a way to have the same behaviour in debugger for firefox 33 and developer edition?

Thanks in advance, best regards

jlgetxo
  • 3
  • 2
  • 1
    Do you have the frame switcher tool enabled? You do this [here](http://note.io/1vQBzHe) and is [accessed here](http://note.io/1zxkiRn). This is a newer feature. – therealjeffg Nov 27 '14 at 05:48
  • Thank you canuckistani. The frame switcher tool was disabled, but it doesn't change the behaviour. I always see the correct html source in the inspector tab, but not in the debugger tab. If I select some javscript code in the inspector and select "show in debugger" it jumps to the debugger tab, but the html code is completely different. I have checked the logs in the web server and no other web page is requested from firefox. – jlgetxo Nov 27 '14 at 12:06
  • More tests: if using the frame switcher tool I select pages in different frames (classical frames, not iframes) in the inspector tab I can see the correct html source, but in the debugger tab some pages don't have html and I get the message "This page has no sources". The page I'm interested in always shows a wrong html source. – jlgetxo Nov 27 '14 at 15:00
  • It's really hard to give you an answer without an example to reproduce with. Sorry I can't be of more help. – therealjeffg Nov 27 '14 at 18:43
  • Hope this helps, an example [here](http://jlgetxo.pythonanywhere.com/test/index.html) A page with some frames, and in the debugger if I switch to a page I obtain the message "This page has no sources" – jlgetxo Nov 30 '14 at 17:19
  • Thanks, logged [a bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1108699), feel free to create a bugzilla account and cc yourself to follow progress. I suspect we just hadn't tested with framesets. – therealjeffg Dec 08 '14 at 19:27

1 Answers1

0

This is what GC does to you

Short answer, the HTML of the frame was being garbage collected away by the browser engine. This happens when the page/html has no script active on it which has still some work left to do.

This can be otherwise prevented by holding a strong reference to any object in the page and putting it somewhere where the browser thinks that its still being used.

For example,

window.foobar = some_object_from_the_page

will work.

Here is the root cause and a potential & partial fix is coming up in near future.

Community
  • 1
  • 1
Optimizer
  • 263
  • 2
  • 8
  • Thanks optimizer. Holding a strong reference solves the problem if I select a page using the list of pages in the left side of de debugger pane. But the problem (this page has no sources) still persists when using the frame switcher tool – jlgetxo Dec 20 '14 at 22:18
  • @jlgetxo Well, then we will just have to wait for the platform fix to land for the *real* fix. PS, I am aiming for some achievement, so please do not upvote this answer yet :) – Optimizer Dec 20 '14 at 22:27