*sigh*. I didn't reply all ...
On Aug 15, 2:04 pm, sewpafly <
sewpa...@gmail.com> wrote:
> There are several issues while using it in safari such as:
> - you're unable to save mappings because GM_* functions don't appear
> to exist in GreaseKit
> - transparency doesn't work
> - probably many more issues since I just started trying it
>
> I don't really care about transparency and mappings I can fix it by
> modifying the defaults in the script.
You can get transparency working by using webkit* css descriptors in
addition to the Moz* descriptors, like such:
MozBorderRadius = "10px";
webkitBorderRadius = "10px";
MozOpacity = "0.5";
webkitOpacity = "0.5";
and
this.backgroundNode.style.MozOpacity = "0.70";
this.backgroundNode.style.webkitOpacity = "0.70";
You can also get the GM_* convenience functions (mostly) working by
adding the following:
// Add Missing GM_ API functions for GreaseKit
//
if (typeof(GM_addStyle) != 'function') {
function GM_addStyle(css) {
var head = document.getElementsByTagName('head');
if (!!head) {
var style = document.createElement('style');
style.type = 'text/css';
style.textContent = css;
head[0].appendChild(style);
}
}
}
if (typeof(GM_setValue) != 'function' && typeof(GM_getValue) !=
'function') {
function GM_setValue(name, value) {
document.cookie = [
name, '=', escape(value),
';expires=', (new Date(new Date().getTime() + 365 * 1000 * 60 * 60
* 24)).toGMTString()
].join('');
}
function GM_getValue(name, value) {
var r = new RegExp(name + '=([^;]*)'), m;
if (m = document.cookie.match(r)) {
return unescape(m[1]);
}
return value;
}
function GM_delValue(name, value) {
if (GM_getValue(name, false))
document.cookie = name + '=;expires=Thu, 01-Jan-1970 00:00:01 GMT';
}
} else {
var GM_delValue = GM_setValue;
}
The only other main bits that are missing are the fixes for
addEventListener (given above) and the use of Iterators (also defined
above).
> I'm wondering if Santiago wants to fork off a version for the Mac and
> maintain that. Anybody interested?
I'm definitely interested in a single, unified script for both FF and
Safari/Mac so that I do not have to continue to backport features or
maintain multiple scripts.
Best,
~d