It's hard to debug the friendconnect.js script because it's compressed, I don't know of an svn or a github repository...
But seeing that the "charAt" errors continue without being corrected I decided to take a shot at a little bit of debugging.
I've copied the code in local and put some breakpoints.
There's an "aa" variable that is being overwritten a few times. First it's defined as a function, then as an array, then as a string representing a url...
So when it's supposed to be representing a url string as in line 880:
else{if(aa.charAt(0)=="/"){af=y(s,gadgets.rpc.getOrigin(window.location.href))
}}
it's actually an object, which is why it's generating the error
Uncaught TypeError: Object #<Object> has no method 'charAt'
If I do a "console.log(aa)" at line 880, this is what I get:
friendconnect.js:879- a: Array[1]
- 0: "resize"
- length: 1
- __proto__: Array[0]
- concat: function concat() { [native code] }
- constructor: function Array() { [native code] }
- every: function every() { [native code] }
- filter: function filter() { [native code] }
- forEach: function forEach() { [native code] }
- indexOf: function indexOf() { [native code] }
- arguments: null
- caller: null
- length: 1
- name: "indexOf"
- __proto__: function Empty() {}
- join: function join() { [native code] }
- lastIndexOf: function lastIndexOf() { [native code] }
- length: 0
- map: function map() { [native code] }
- pop: function pop() { [native code] }
- push: function push() { [native code] }
- reduce: function reduce() { [native code] }
- reduceRight: function reduceRight() { [native code] }
- reverse: function reverse() { [native code] }
- shift: function shift() { [native code] }
- slice: function slice() { [native code] }
- some: function some() { [native code] }
- sort: function sort() { [native code] }
- splice: function splice() { [native code] }
- toLocaleString: function toLocaleString() { [native code] }
- toString: function toString() { [native code] }
- unshift: function unshift() { [native code] }
- __proto__: Object
- c: 0
- f: "gfc_iframe_1642769180_0"
- l: false
- origin: "http://p7rjrrl49ose4gob99eonlvp0drmce3d-a-fc-opensocial.googleusercontent.com"
- referer: "http://p7rjrrl49ose4gob99eonlvp0drmce3d-a-fc-opensocial.googleusercontent.com"
- s: "subscribeEventType"
- t: "443731538"
- __proto__: Object
So it's clearly not representing a url querystring!
If you look at the source code, at line 716 we have:
var O=(function(){function aa(ab){return function(){S(ab+": call ignored")
So here "aa" is a function.
At line 729 we have:
If I do a console.log(A[af]), we have an "undefined", so "aa" is becoming an array here (if not A[af] then [] array).
And I don't really understand what the code is trying to do in the following lines. If in fact "aa" is becoming an empty array in line 729, then:
var aa=A[af]||[];
for(var ac=0;
ac<aa.length;
++ac){var ae=aa[ac];
ae.t=B(af);
In line 730 we have a for cycle, which has the condition "do until ac<aa.length". But guess what, if "aa" is an empty array then this cycle won't take place will it. I'm supposing that's the desired behaviour, but maybe it could take a double-check...
In line 739 "aa" is being defined as a function again:
In line 763 "aa" is cast as "o[ae.s] else o[P]":
var aa=(o[ae.s]||o[P]).apply(ae,ae.a);
When I console.log o[ae.s] and o[P], I see that they are both functions.
So "aa" is being defined as another function.
In line 771 "aa" is cast as "as.indexOf('/')":
In line 791 "aa" is cast as a window frame:
var aa=window.frames[ac];
In line 793 "aa" is cast as a DOM element:
aa=document.getElementById(ac);
And I'm supposing that "ac" is a frame because in line 794 we have "if aa && aa.contentWindow".
Well, I console.logged document.getElementById(ac), but there was no log, so I'm supposing it's within an if statement that is not verifying as true...
In line 798 "aa" is cast as "L(ad)". Console.log(L(ad)) returns a url:
In line 832 "aa" is cast as "T[ab]". Console.log(T[ab]) gives:
And in the following lines we have string operations that have to do with "aa" and the value of "aa".
In lines 869-874, "aa" is being treated as both a string and an object:
function h(aa,ac,ae,ad){if(aa===".."){var ab=ae||e.rpctoken||e.ifpctok||"";
if(window.__isgadget===true){b(ab,ad)
}else{U(ab,ac,ad)
}}else{n(aa,ac,ae,ad)
}}return{config:function(aa){if(typeof aa.securityCallback==="function"){F=aa.securityCallback
}}
First, "if aa==='..' ", then "if(typeof aa.securityCallback==='function') ". First it's expected to be a string representing a directory I'm supposing, then it's treated as an object containing the function securityCallback.
And in the following lines "aa" is referred to continuously, but it's an object containing all the elements that I posted at the beginning of this post.
It's expected to be a url string in line 887, but it's an object. This is where all the errors are being thrown. Lines 886-888:
if(aa===".."){af=s
}else{if(aa.charAt(0)=="/"){af=y(s,gadgets.rpc.getOrigin(window.location.href))
}}
I would highly recommend that the friendconnect team look into this. There needs to be some debugging of the code. If it's not a problem in the source code then it's a problem in the way the code is being compressed, there's probably some closure that's not being closed properly and "aa" (whatever that is in the source code) is being cast multiple times in the same context.
The lines that I refer to in this post are probably one line off (incrementally), because of me adding "console.log"s to the code.
Please look into this.