Requests for scripts to be adapted
|
|
I'm opening this thread with the intent of posting a list of really really great scripts on uso that don't currently qualify for inclusion in this group (as they're not cross-browser), but that members of this group could hopefully work on adapting to include them.
I'll start the ball rolling with something I think looks like a potentially great project. GM_config Changes to be made:
|
![]() ![]() |
I'm actually very interested in modifying GM_config to be cross-browser. Sorry I've been so slow to get around to it. I've been preoccupied.
|
![]() ![]() |
I'd really like to see an Opera version of one of the scripts that integrates Google Reader into Gmail. There are a handful of them around, but this is seemingly the most interesting: http://userscripts.org/topics/18054?page=1#post... I posted in a thread for that one a while ago, but noone there seems too interested. Anyone here willing to give it a stab? |
![]() ![]() |
Another thought: I seem to have to reload gmail once every time i load it before the auto signin works. I have the cookie setting on "accept from site you have visited," and to delete new. I think this is the problem, but I can't find a solution online. Not sure if anyone else has this problem? One solution would seem to be a script that automatically reloads Gmail the first time it loads (that is, if javascript can do that kind of thing). Thanks. |
![]() ![]() |
I'd love to see Travian3 Beyond - ML&CN
be adapted.. |
![]() ![]() |
Coldframe wrote: I gave my advice to the author. |
![]() ![]() |
Any suggestions how this could be made Opera compatible. It gives a 'return must be within a function' error right now & pushing it inside the anonymous function doesn't help. Im testing on Opera 10.51 btw. |
![]() ![]() |
1nfected wrote:For starters you're using localStorage improperly. Here's a proper example(mostly taken from GM_config which is now cross-browser) of implementing cross-browser GM-api replacement functions: var isGM: typeof GM_getValue != 'undefined' &&
typeof GM_getValue('a', 'b') != 'undefined',
log: (this.isGM) ? GM_log : (window.opera ? opera.postError : console.log),
setValue = isGM ? GM_setValue :
function (name, value) {
return localStorage.setItem(name, value);
},
getValue = isGM ? GM_getValue :
function(name, def){
var s = localStorage.getItem(name);
return s === null ? def : s
};
Using these you can properly test for whether you're in Greasemonkey(isGM), log messages in the console(log()), and set and get persistent values(setValue()/getValue()). For more information, I also wrote a huge ass guide recently that features a section on making your script cross-browser friendly. |
![]() ![]() |
cool, will check it out and post back.
|
![]() ![]() |
@sizzlemctwizzle: Don't forget that localStorage is "string" only...
My cross browser GM Api is here: http://userscripts.org/topics/41177#posts-198077 |
![]() ![]() |
GIJoe wrote:Yeah true but you just need to make sure to cast the string to a number like setValue("name",1); return +getValue("name",0)+1 which will return 2. You could make this conversion automatic my modifying the getValue function.
var getValue = isGM ? GM_getValue :
function(name, def){
var s = localStorage.getItem(name);
return s === null ? def : isNaN(s) ? s : +s;
};
|
![]() ![]() |
Well, i've been trying to write cross-browser compatible code. Thanks once again sizzlemctwizzle for that piece of code. I've used it (and also GIJoe's cross-browser GM Api) and now my script is semi compatible with Opera. Everything works except for adding the menu part. I get the following error: guser error : TypeError: Cannot convert 'document.getElementById("guser")' to objectI get this with both the methods (urs and GIJoe's). I've upped the code at Pastebin. Any way i can overcome this error? @GIJoe: I came across this discussion topic in your Youtube script & tried the solution mentioned there as well, but to no avail. |
![]() ![]() |
Is |
![]() ![]() |
GIJoe wrote:Yeah, it is infact null :s Could that be because of security restrictions on iframe? |
![]() ![]() |
bumpy... |
![]() ![]() |
1nfected wrote:The only reason getElementId would return null is if that element is not on the page. Either way it has nothing to do with cross-browser compatibility. |
![]() ![]() |
sizzlemctwizzle wrote: I'm quite certain the element exists. Can see it in dragonfly using the Inspect Element option. And the same code works in Firefox & Chrome. |
![]() ![]() |
Try looping until it is not null... |
![]() ![]() |
GIJoe wrote:Already tried that & a whole lot other ways... Actually, i was wrong earlier, var guser = gmail.getElementById("guser"); does not return null.
The problem lies in this line guser = guser.firstChild; (ie when i'm trying to access the firstChild property, even children[0] doesn't help) The browser hangs when it reaches this line :s
|
![]() ![]() |
check guser.childNodes.length or guser.innerHTML |
![]() ![]() |
GIJoe wrote: check guser.childNodes.length or guser.innerHTMLlet me try that, but i'm guessing that would make the browser hang, since its again accessing a property of guser. i'll report back after giving it a try though. edit: well, i was able to access both the properties you mentioned & they return the correct values. but as soon as i try to access firstChild property, the browser hangs! and i also noticed, opera in such situations does not log the last few msgs either. for eg in the following code: var guser = gmail.getElementById("guser");
if(guser == null) { log("guser is null"); return; }
else {
log("found guser!");
guser = guser.firstChild;
}
i wouldn't see any msg in the console. but if i put an alert statement after log("found guser!"); i could see the msg.
|





