debug Greasemonkey JavaScript

I experimented on my script to make it work for one of the most technical blogs on blogs.sun.com.

Miles to go ...: Arun Gupta's Weblog

Arun Gupta is a Technology Evangelist for Web Services and Web 2.0 Apps

I managed to make it work. I could embed 'Print' link as in the screenshot below.

Since I'm not good at languages other than bash and SQL, I had to rely on old debugging technique, as in line#42,#46,#47 below.

Had it been easier if I used NetBeans JavaScript debugger ?

NetBeans for PHP : weblog

screencast about JavaScript debugging in NetBeans 6.5



41 if(postDivChildren){
42 //document.body.innerHTML = postDivChildren[0].innerHTML;
43 for (var i = 0; i < postDivChildren.length;) {
44 var thisDate = postDivChildren[i++];
45 while((!thisDate || !thisDate.tagName || thisDate.tagName != "H2") && i<postDivChildren.length){
46 //document.body.innerHTML += postDivChildren[i].innerHTML;
47 //document.body.innerHTML += " searching Date..";
48             thisDate = postDivChildren[i];
49         }
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today