最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

google chrome - Javascript, Losing console.log between url posts - Stack Overflow

programmeradmin1浏览0评论

I am trying to watch my javascript code using the console.log(text) command - and it does work... but the console gets flushed everytime the url changes.

Is there any way to persist my console logs between page changes?

I am trying to watch my javascript code using the console.log(text) command - and it does work... but the console gets flushed everytime the url changes.

Is there any way to persist my console logs between page changes?

Share Improve this question asked Jun 8, 2011 at 14:30 CielCiel 17.8k24 gold badges106 silver badges200 bronze badges 1
  • 1 [In Chrome] It looks like you can preserve the Network activity log between navigation but not the console itself. Take a look at an identical question stackoverflow.com/questions/5928492/… – Colin Commented Jun 8, 2011 at 14:39
Add a comment  | 

4 Answers 4

Reset to default 17

Click on the bottom-right corner gear icon in the Chrome developers tool, check 'Preserve log upon navigation' option and you are done.

For the record, these days both Firefox and Chrome have 'persist' options in their inspectors / conosole. You need to right click in the console window and then select the relevant option tfrom the popup menu.

There isn't a way to do this yet but from what I've read it is a future feature they will implement. Here is the Issue ticket on it: http://code.google.com/p/chromium/issues/detail?id=77058


EDIT: Chrome has implemented this feature. Read the answer below

There's only 1 way that I know of, but not with Chrome: With the built-in Web Inspector in Firefox 4+, which doesn't flush the logs between pages.

@scrappedcola notes that Firebug does this as well, but I'm referring to the built-in inspector.

发布评论

评论列表(0)

  1. 暂无评论