PDA

Просмотр полной версии : User Js и Css


2Born4Life
07.03.2009, 19:03
Если вопрос. Как можно интегрировать css в user.js ( не путать с js ).
нужно не просто написание css внутри скрипта типа

/*
* Title: GMail CSS Skin
* Description: Greasemonkey script for Firefox to change the appearance of GMail
* Author: Lucas Garcia, www.lgarcia.org
* Updated: 29/11/2005
*
*/

// ==UserScript==
// @name css1
// @namespace *******************
// @description *******************
// @include *******************
// @include *******************
// @include *******************
// @exclude *******************
// @exclude *******************
// @exclude *******************
// ==/UserScript==

(function():x:x
function addGlobalStyle(css) :x:x
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) :x:x return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}

var cssStyle = '.p :x:x margin-top: 5px; color: #3366cc; font-weight: bold; } .ct :x:x color: #006633; } span.lk :x:x text-decoration: none; font-style: italic; font-size: 11pt; font-family: Trebuchet MS, Georgia, Arial;} div.nl :x:x background-color: #E8EEF7} #nb_1{ display: none !important } span.lk#refresh :x:x text-decoration: underline; font-style: normal; font-size: 10pt; } table.tlc tr.ur :x:x background-color: #fff !important; } table.tlc tr.rr :x:x background-color: #E8EEF7 !important; } table.tlc tr.ur td, table.tlc tr.rr td{ border: 0 !important; line-height: 1.5em} table.tlc tr.rr:hover{ background-color: #B5EDBC !important; } #nb_0 img :x:x display: none } #nb_0 :x:x font-size: 10pt; } #nb_0 table td.s :x:x padding-top: 2px; padding-bottom: 2px; color: #006633; font-style: italic; font-weight: bold; } input, button :x:x padding: 3px !important} div.h#ds_inbox img :x:x display: none } div.h#ds_inbox :x:x background-image: url(http://static.flickr.com/34/68354073_a68a090fc7_m.jpg) !important; width: 143px !important; height: 59px !important; background-repeat: no-repeat !important; } span.lk:hover :x:x color: green; text-decoration: underline; } span.lk#prf_g :x:x font-size: 10pt; font-style: normal; text-decoration: underline; } div#nav sup :x:x display: none !important; } div#ft :x:x display: none !important; } #il :x:x display: none !important; } div#nav :x:x margin-top: 5px } #tamu :x:x font-family: Verdana; font-size: 9pt; color: #3366cc; height: 24px; line-height: 1.5em; font-weight: bold; } span.lk#ds_trash :x:x color: #c00 } span.lk#ds_spam :x:x color: #999 }';

addGlobalStyle(cssStyle);
})()





а именно редирект на иной ксс где нить на хостинге.

и еще вопрос. можно ли как нибудь с помощью user.js заставить браузер игнорировать родной css сайта ( любого ) и сипользовать Ваш. ( опять таки где нить в Жо находящийся)

Заранее Спасибо