debugging firefox extensions - debugging

I'm building an extension for Firefox.
I've checked the javascripts and they work well.
I've tried to make all the modules of the extensions right. But every time I try to install the plug-in into my firefox it says "Impossible to Install.. the component is damaged".
I'm looking for an "extension debugger" that can find the error that makes my add-on not working. Any advise?

I was looking for a link to Firefox background page debugging.
I found this link to Firefox debugging.
It says to follow these steps:
open Firefox
enter "about:debugging" in the URL bar
check the box labelled "Enable add-on debugging"
click the "Debug" button next to your extension
click "OK" in the warning dialog.

I don't think there is a dedicated debugger for that. Look at this article, maybe it can help: http://blogger.ziesemer.com/2007/10/javascript-debugging-in-firefox.html
Regards, Hiawatha

There are some debuggers for Firefox extensions, inparticular Venkman and Chromebug (which only works reliably with Firefox v5).
These will be able to break (pause code execution and launch debugger) when an exception occurs but don't usually help when you've got packaging problems, which are often caused by
Bad manifests - look though Mozilla's packaging documentation, in particular the format of manifests.
Errors in XML - validate all XML files (such as install.rdf).
Referenced files that are missing (e.g. a DTD referenced in the XML that is missing)
With the lack of tools, the best option is often to compare your extension's manifests and directory structure against a known good extension (e.g. an example Hello World extension, or an earlier version of your extension) as something as simple as a wrong entity in a DTD file can cause the error you are seeing.
Is this is a classic extension or the more recent bootstrapped type?

I would recommend to check the text encoding of install.rdf, chrome.manifest and bootstrap.js. Anything else than ANSI would be a cause of troubles.

Related

Detect file changes outside the Visual Basic 6 IDE?

Background
I am working with VB6 legacy code and I am using an external editor because of the features that it has. Unfortunately, those changes aren't refreshed in the IDE because VB6 doesn't monitor loaded code for changes.
I have done some extensive searching on the subject including looking for alternative editors, a fairly exhaustive internet search including following all of the links on this StackExchange link and haven't found a way to refresh the code window to reflect the external file changes.
My company doesn't have access to the latest edition of Visual Studio and will not be purchasing it anytime in the near future. Until then, there is code to fix.
Question
Aside from restarting the program are there any methods that can be used to refresh the code displayed in the VB6 editing window?
Check out vbAdvance add on. It will prompt you to reload source file in case of external modification.
I think a found one possible solution.
The MZ-Tools set has an function called Reload file from Disk. It also allowed me to create a shortcut for this function through the MZ-Tools options menu, so I assigned it to the shortcut keys of my choosing.
It's a solution, but I'm still looking for anything that might be better.

How can I disable javascript compile warnings in VS 2010?

Visual studio seems intent that my javascript code is bad, mostly because it has no knowledge of jquery or some plugins I am using. Therefore, every time I compile my product it gives me a lot of warnings, most of them are incorrect ($ is not defined, window is not defined, etc...).
I have /// <reference path="" /> tags setup in my javascript with intellisense working properly so I know these are just not real issues.
How can I disable these warnings?
edit to be clear, I need these disabled because it's causing 100+ warnings that are making me lose sight of REAL c# warnings.
I had the exact same issue you were having: 100s of incorrect errors every save. For me the issue was with Chirpy, which was a prerequisite for another extension. For whatever reason on my end, Chirpy was not in my Extension Manager so it took me a while to find.
Check and see if you have it installed. If so disable JSHint.
Tool -> Options
Chirpy -> JSHint
Uncheck: Run JS Hint
try this and let me know if it works.
Enter the options through Tools > Options.
In the tree to the left, choose Text Editor > JScript > Miscellaneous. Uncheck "Show syntax errors".
I don't have a javascript source file on the computer I'm on at the moment to test this, but you may be able to use the #pragma command to disable particular warnings:
#pragma warning disable will disable all warnings, and #pragma warning restore will restore all warnings when placed at the end of your code block. You can also tell it to disable only particular warnings, such as #pragma warning disable 0219,0168.
http://abhijitjana.net/2010/08/27/how-to-suppress-complier-warning-using-pragma-warning-directives-in-visual-studio/
Interesting I am not able to reproduce your issue in neither VS2010 "website" project nor vs2010 "web application" project. It has to do with the add-ons that you installed. Probably you may have a setting in that add-on (who ever is causing this) to disable warnings.
To me the warning sounds like the add-on (who ever is causing this) is not intelligent enough. Try the below changes and see if that helps.
If you have master page then try move the jquery*.js script reference from master page to your actual page
Move all your javascript code into a js file instead of writing it them under script tag
Thanks,
Esen
What about this one?
To disable a single compiler warning
With a project selected in Solution Explorer, on the Project menu, click Properties.
Click the Compile tab.
In the Warning configurations table, set the Notification value for the warning to None.
or perhaps this one
Tools > Options > Text Editor > JScript > Misc > Show errors as warnings( uncheck only this )

Webstorm debugging with Chrome?

I am unable to debug at al in Chrome. I set it as my default broswer but when I try to debug, I see Connecting to 127.0.0.1:7930 in the Debugger window, but nothing happens (Chrome doesn't popup or anything). I have no idea how to trouble shoot this....any ideas?
If you are not familiar with, and believe me its worth checking out...another alternative is to use the Chrome developer Tools Built into the browser
You can debug javascript (add breakpoints and step into over, view variables), edit css and see your modifications in real time and save changes back to your file system. It also has a revision history for changes you make and you can revert back to any version! You can use use these Chrome developer tools in conjunction with the free Netbeans IDE where you can create your HTML, CSS & Javascript which has excellent code hinting / completion with Jquery support. You also add plugins to add more functionality.
Well I could not figure out how the heck to get Webstorm to debug with Chrome and their support is extremely limited. So as a workaround and what may be better because its free , is use Eclipse with Chrome Developer tools.
You are able to debug all the JavaScript files on your server and set breakpoints. I haven't stepped through while debugging, but this seems very promising. You could use Eclipse as well for the development of your corresponding HTML and css files or use in conjunction with Netbeans which is also free. Very straightforward if you are familiar with Eclipse already:
Eclipse with Chrome Developer Tools

Why doesn't VS2010 debugger stop at my breakpoints?

I am working on a C#.NET class library project in VS2010. In my project settings -> debug settings, I have the project set to start an external program (C:\Windows\SysWOW64\wscript.exe) which runs a very simple jscript file (test.js). The script simply creates an instance of the class and calls one of it's methods.
The problem is when I start debugging, VS2010 does not stop at any of my breakpoints. If I open up the exact same project in VS2008 it does stop at the break points. Is there a new setting somewhere that is preventing the breakpoints from being hit? Has anyone else ran into this issue?
My first check would be to disable "Just My Code"
Tools -> Options
Debugger
Uncheck "Enable Just My Code"
Try the scenario again.
To solved this problem by creating a config file for the application which is using the component to debug with the following data:
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
With this file you tell the debugger to use the right runtime version for debugging (it seems the debugger uses version 4.0 by default).
I have a tried a whole day to find out why I couldn't debug my visual studio 2012 console application, and the answer was embarrassing.
I was running it in "RELEASE" mode.
Sometimes the obvious is the hard to find.
Close the Visual Studio IDE and Open it. Now it will work. For me it also face the same issue. I used this way to overcome
I had a "Rebuilt" VS2013 project that I couldn't debug (no symbols). Finally, I saw Optimization was checked (Project->Properties->Build). I unchecked it and Rebuilt. Symbols loaded finally. My two cents, only use (compile) Optimization when absolutely necessary.
While I can't answer why it happens, I can provide you with workaround.
Include
using System.Diagnostics;
At the very beginning of your code (Class constructor for instance) place the following lines:
#if (DEBUG)
while(!Debugger.IsAttached);
Debugger.Break();
#endif
Start debugging.
Menu Tools→Attach to Process
Attach to your process.
breakpoint should trigger in your code.
Other breakpoints should trigger as well.
Could be a number of reasons. Usually it's because you're trying to debug against the wrong version.
These actions work about 80% of the time.
Get the latest code
Clean
Rebuild
Restart IIS
Try again
If no good, go to Debug > Windows > Modules and if the relevant dll is there, right click it and load symbols.
If it's not in the list, try running the code anyway. Sometimes even though it says the breakpoint will not be hit, it's only because the dll is not loaded until you enter a scenario that needs it. Try the scenario that depends on the dll, and it may just hit the breakpoint anyway.
Oh one more idea, restart your browser. You might have something cached from an older dll.
If the reason is wrong .NET runtime version (which was my problem), instead of creating configuration file you can simply choose the right version in the Attach to process dialog.
In the dialog, next to Attach to click on Select and switch from Automatically... to Debug these code types where you should check the right version.
If this was your problem also, then you probably had "Symbols not loaded" message on your breakpoints. Immediately after selecting the right version you should see that this error is no longer reported.
For me it was fixed by:
Open the project properties is VS2010
Goto Compile -> Advanced Compile Options
Change 'Generate debug Info' from 'None' to 'Full'
The problem could be your browser is using a cached version of the page, you are working with.
Try to add som nonsense extra querystring in your adress line of the browser f.x. add ?NONSENSE=1234
This forces the browser to use a new version of the web page since it does not know if the page should look different with this Query in the end. Next time use ?NONSENS=1235.
I had a problem with misplaced breakpoints in my native c++ code.
The reason was I had been editing the code so some line ends in the code was not \r\n. It was not possible to see in the code unless you searched for \r\n.
After inserting the proper line ends \r\n the debugger worked.
I encountered the similar issue but its in a CLR project. I had some old c++ syntax in the CLR project. For me after I enabled 'Use managed compatibility mode' in Tools>options>Debugging>General it started to hit the break points.

Suppress "No Source Available" pane in 2010

Arg! I have a custom "harness" executable running my class library project. Every time I step into the harness's code, I get that "No Source Available" pane popping up. As I know there is no source available, and that this is completely expected, I don't want this very intrusive and useless pane popping up every time. How can I suppress it completely?
I can make it smaller at least by making that window part of another smaller pane-set, such as with the watches/locals. It remembers its location from run to run, but its still useless.
There might be a more general answer to this question - how can I suppress any particular pane/window from showing at all? I have a VSX package, originally built for VS 2008 (and must keep that compatibility) but I just don't know what command to run to do it. (I had the package commissioned, so I have the source, but not the know-how. This seems like a one/two liner).
Thanks!
Here is a link to an add-in that correct the bug:
http://visualstudiogallery.msdn.microsoft.com/en-us/fdbb2036-471e-40a7-b20e-31f8fd5578fa
This work great for me.
This worked for me:
Tools > Options > Debugging and untick Enable Just My Code
(thanks to this)
If you have enabled source server support, the solution is here: No Source available
After finding no help on this, I dug in to it myself and fixed it by Hiding the WindowFrame in the event that it is shown. There is no visual refresh glitch that I've seen so far.
Here is the GUID for the "No Source Available" pane: {1820bae5-c385-4492-9de5-e35c9cf17b18}
I found most of what I needed from this post:
http://blogs.msdn.com/dr._ex/archive/2004/11/07/253601.aspx
I believe this will only affect solutions with this package loaded, but really I don't know if the package stays loaded/active if the related project is closed.

Resources