How do you set up firebug to debug a grease monkey script?
I've installed firebug on both my laptop and pc. On my laptop it works fine, all the grease monkey scripts are listed under the script tab. However on my pc they don't appear which is unfortunate because I want to work on my pc. They've both got the same versions of firebug, firefox and windows and I have tested them on the same webpage. I can't see any difference in the settings between the 2 machines so am baffled as to why one is working but not the other. Please does anyone have any suggestions as to how to sort this?
You can try using
debugger;
in your code if you haven't already. I've had this work in the past, though it can be finicky.
Sorted this by creating a new profile in firefox.
Related
How to debug Greasemonkey scripts in Firebug?
I can't debug any Greasemonkey scripts in Firebug because they don't appear in the list under the Script tab (anymore).
The answers at "How to debug Greasemonkey script with the Firebug extension?" apparently don't work with the latest versions of Firefox + Firebug?
I've tried:
Creating a new Firefox profile
about:config setting extensions.firebug.filterSystemURLs to false
Updating to Firebug 2.0.2
I had this problem before and solved it by creating a new Firefox profile but that hasn't worked this time.
Please does anyone know how to get this working or if there is an alternative to Firebug that works with Greasemonkey?
I'm on Firefox 31.0.
Issue 7513: 2.0 cannot debug userscripts in Greasemonkey
Firebug 1.x works with Greasemonkey 1.x well, while I can debug userscripts installed in Greasemonkey using Firebug to set a breakpoint. But after I upgrade my Firefox to 30 and the Firebug was upgraded to 2.0. It seems does not work any more.
Project Member simon.lindholm10
Not that surprising, the method of script discovery changed pretty fundamentally in 2.0... Previously we were iterating over all scripts everywhere and trying to tie them somewhere, now we start from the web page and hook script creation for it, which is much more sane.
The way to get this fixed (presuming it doesn't work in the built-in debugger) is to file it against Devtools at https://bugzilla.mozilla.org, or against Greasemonkey; there's very little we can do on the Firebug side I believe.
Anyone know how you get the yellow popup to appear when inspecting javascript variables in chrome? Apparently you just hover over the variable when the debugger is paused to see a variables current state but for whatever reason I can't get this to work.
If you have no idea what I'm talking about checkout this screenshot:
This happened to me before. Just close all Chrome instances or restart it. This should fix the problem.
I have no idea why this wasn't working but I tired a clean install of chrome on a different user profile on my mac and worked fine. So I went back and dumped all the preferences and application support files and turned off all extension on my profile and it worked!!! So moral of the story do a clean install of Chrome.
The same thing happened to me on 16/12/19, with version 79. But in Chrome canary, it is working fine. People who need can download it here (you can use it for now) or you can use Chrome Dev here
For the people who don't know about Chrome Canary or Dev
Chrome Canary is an experimental version of the popular Chrome browser. Google offers four release channels for its Chrome browser: Stable, Beta, Dev, and Canary. Most people use the Stable release of Chrome, which is rigorously tested and considered very reliable.
By contrast, Chrome Canary may appeal to people who like noodling around with new technology and want to get an advance look at what the standard Chrome browser may look like in the future.
I was wondering if there are any useful tools people have found to debug javascript on an iPad which is not jail broken. It is an iPad supplied for work so jail breaking is not an option. Through some tedious steps I have gotten firebug-lite working on the iPad but my debugger statements in the javascript are not being hit. There is also no capability that I am seeing to set breakpoints as you can traditionally with Firebug.
I also have Safari's debug console open but that is fairly useless for what I am trying to accomplish.
Thanks for any ideas.
Did you look at webkit remote debugging protocol? It seems they know people want a debugger for their iPad but still no real world native iPad remote debugger is available out there.
But don't get disappointed, there is a tool called weinre that doing what webkit folks willing to do in the future right now!
Update:
By release of Google Chrome for Android phones remote debugging and tablets debugging mobile web apps is no pain anymore. You will need an expensive Google Galaxy Nexus phone with ICS on it to do it. But future is bright! Check out the video demo here:
weinre is Web Inspector Remote. Pronounced like the word "winery". Or
maybe like the word "weiner". Who knows, really.
For those coming to this question from Google, there is now a Web Inspector available in iOS Safari (scroll down to "Safari on iOS"). Note that it requires a Mac computer to use.
Have you tried Firebug Lite?
I haven't used it on the iPad, but I don't see why it wouldn't work.
I'd probably set a conditional include based on if a query param is set - for instance (php)
<?php if(isset($_GET['debug'])): ?>
<script type="text/javascript" src="firebuglite.js"></script>
<?php endif; ?>
Try iDebug. You can direct download it from AppStore onto your iPad. Here's the AppStore Link.
I have recently written a tool for showing console logs in a movable/resizable "window" (actually a div). It provides similar functionality to Firebug's console but you can see it over your page on a tablet. Tablet/Smartphone/Phablet Debug Console
You can also use Firefox's built in WebIDE with Valence
Plugin your device > in Firefox click on the spanner icon > find WebIDE > under "OTHER" click on "Safari, Firefox, and other WebViews on iOS"
[1] https://hacks.mozilla.org/2014/11/mozilla-introduces-the-first-browser-built-for-developers-firefox-developer-edition/
[2] https://hacks.mozilla.org/2014/06/webide-lands-in-nightly/
[3] https://developer.mozilla.org/en-US/docs/Tools/Valence
There is actually a way to debug a website in Safari on iOS using Firefox WebIDE on a Windows machine. I wrote an answer at https://stackoverflow.com/a/35714835/306179 further describing this solution, as it was not necessarily straightforward to set up and use. It does not provide all the Developer Tools you would expect from, for instance, Chrome's DevTools suite, but it at least gives the Console, Inspector, and Debugger.
If you have an Apple Mac computer, you can connect it to your iPad.
First you must ensure that you have the Web Inspector enabled ("Settings > Safari > Advanced" and turn on "Web Inspector").
Then connect your iPad to your Mac via an USB cable.
After that I can choose in the "Develop" Menu of Safari to debug the website displayed on my iPad/iPhone.
Source of images and original information:
https://webdesign.tutsplus.com/articles/quick-tip-using-web-inspector-to-debug-mobile-safari--webdesign-8787
Not sure if I'm allowed to re-post my answer from another question, as it's often frowned upon, but in Debug iPad Safari with a PC I posted 3 options of JS console and logging tools that can assist with troubleshooting issues on iOS devices, with screenshots and sample code snippets. One of these is an open source tool I built myself, but the other two are probably even more advanced.
They all make up for the lack of a proper Javascript console and error log in iOS. There's also some additional tools mentioned in the link above. The answers there are likely relevant to this question also.
You can try using Firebug Lite as a bookmarklet. You should be able to use all features without changing the code of your app as Jesse suggested. See this link.
I'm not a Windows Phone developer, and I want as little to do as possible with anything related to Microsoft. Nonetheless, I need to get my mobile web app running properly on Windows Phone 7. What debugging tools are available for the platform? Something like the Webkit developer tools or Firebug would be ideal, either from the phone itself or more likely, remotely debugging from my computer.
If such a thing doesn't exist, I'd settle for being able to read Javascript error messages, and view the contents of variables using alert() or similar. At this point, all I know is that my JS is failing: I don't know where or why, let alone how to fix it.
My dev computer is running OS X, and I'd really like to be able to use these tools from OS X if possible. Assuming that debugging tools exist (which I really hope they do) are they designed for Windows only? If so, does anyone know how well they would work with Wine or similar?
EDIT: I have a physical Windows Phone 7 device, so I can use that. However, alert() doesn't seem to be working, which is why I'm posting this question. Does alert() normally work on the WP7 browser?
You'll likely find the Mobile Perf Bookmarklet to be the easiest all-in-one tool for testing any mobile device.
Works well on the iPhone/iPad/Samsung Galaxy Tab in my testing so far.
Quote:
It displays a menu with links that load other bookmarklets including Firebug Lite, Page Resources, DOM Monster, SpriteMe, CSSess, and Zoompf.
Unless you have a Windows Phone 7 device, you will need to run Windows in BootCamp and install the Windows Phone Developer Tools in order to test in IE on the emulator. I don't know about Whine, but I ran into major problems trying to test in Parallels - so based on my experience, I suggest keeping it as simple as possible.
There is no console in IE on the phone, so you will need to use alert, like you suggested, or just write text to a div on your page as a custom console.
If you really want to code in OS X (which I definitely understand), using a separate machine for testing IE in the WP7 emulator is going to be your best bet.
EDIT: I just tested alert and it did work fine on my Windows Phone. My guess is that a syntax error is preventing it from calling.
The following may be interesting
Simple IE debug tool for Windows Phone
Supports
Html traversing
Html node styles, properties, metrics
Reading console output
Executing js on device side from console (including intellisense)
Dynamic script injection - ability to debug live sites
Not supported
js breakpoints
Just wanted to add a note to say that full JavaScript debugging is possible now with Windows Phone 8.1 and Visual Studio 2013 Update 2. Full details are available at:
http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/04/diagnosing-mobile-website-issues-on-windows-phone-8-1-with-visual-studio.aspx
I realize that this doesn't help the versions referenced in the original question (WP7), but I'm hoping this will help people who may find this question and are running a more recent version.
Something that has worked for me, is to test my mobile pages through the Windows Vista built-in Internet Explorer browser.
It comes with a script debugger ( which you have to enable in Advanced Options tab through the Internet Options menu ), and it seems that it gets really close to the Internet Explorer Mobile implementation.
Another tip would be, that, instead of using window.alerts, you can also use document.write or set output to a div content.
I'm using this hack to have console.log send info back to the server (it uses window.fetch, which I'm polyfilling, but could use xhr instead) https://gist.github.com/wheresrhys/bf93057ee3a594454582
I have an iPad running some Javascript in a webview, but sometimes it just refuses to work. Does anyone have a way to debug this kind of issue?
You can use bookmarklets to run things like firebug lite: Check the following article for links to how to make bookmarklets installable on mobile safari as well as links to firebug lite.
http://community.godaddy.com/library/setting-up-a-debugging-environment-on-the-ipad/
Recently with the new iOS 6 you can turn on remote debugging and analyze your project with Webkit Inspector on Safari (but only with a Mac, because you must have safari 6.x).
This method would not work on the first generation of iPad too, because they're not upgradeable to iOS 6.
The question is one year old and obviously it wasn't available at the moment. I'm posting it so that someone who come up here could know it.
Info: http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
Another tool you could try is adobe shadow.
Simply enable js console