count up css selector
@@ -1,16 +1,25 @@
/*
* @title count up css selector
- * @description count up css selector
+ * @description count up css selector (Forked)
* @include http://*
- * @license MIT License
+ * @license MIT License http://www.opensource.org/licenses/mit-license
+ * @contributor os0x http://let.hatelabo.jp/os0x/let/gYC-yoT-tImhfg (Fork of)
+ * @author noromanba
*/
+// Changes
+// - fix reference error
+
(function(each) {
each.call(document.styleSheets, function(s){
var t = 0;
- each.call(s.rules, function(r) {
- t += r.selectorText.split(',').length;
- });
- console.log(t, s.rules.length, s.href || 'inline');
+ if (s.rules) { // FIXME guess work
+ each.call(s.rules, function(r) {
+ if (r.selectorText) { // FIXME guess work
+ t += r.selectorText.split(',').length;
+ }
+ });
+ console.log(t, s.rules.length, s.href || 'inline');
+ }
});
}(Array.prototype.forEach));
/*
* @title count up css selector
* @description count up css selector (Forked)
* @include http://*
* @license MIT License http://www.opensource.org/licenses/mit-license
* @contributor os0x http://let.hatelabo.jp/os0x/let/gYC-yoT-tImhfg (Fork of)
* @author noromanba
*/
// Changes
// - fix reference error
(function(each) {
each.call(document.styleSheets, function(s){
var t = 0;
if (s.rules) { // FIXME guess work
each.call(s.rules, function(r) {
if (r.selectorText) { // FIXME guess work
t += r.selectorText.split(',').length;
}
});
console.log(t, s.rules.length, s.href || 'inline');
}
});
}(Array.prototype.forEach));
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。