restore my rights
@@ -9,8 +9,8 @@
*/
(function() {
- Array.prototype.forEach.call(document.body.querySelectorAll('*'), function(node) {
- node.setAttribute('unselectable', 'off');
+ Array.prototype.forEach.call(document.querySelectorAll('*'), function(node) {
+ node.getAttribute('unselectable') && node.setAttribute('unselectable', 'off');
node.onmousedown = null;
node.oncontextmenu = null;
node.onselectstart = null;
@@ -20,6 +20,7 @@
[
'',
+ //'-moz-', // *1
'-webkit-',
'-khtml-',
'-ms-',
@@ -27,9 +28,13 @@
].forEach(function(prefix) {
node.style[prefix + 'user-select'] = 'initial';
});
+ // *1: Fx can not access by indexer; node['-moz-user-select']
+ // e.g. http://www.softel.co.jp/blogs/tech/archives/2909
+ // property works well
+ node.style.MozUserSelect && (node.style.MozUserSelect = 'initial');
});
- if (jQuery) {
+ if (window.jQuery) {
jQuery('*').unbind();
}
}());
/*
* @title restore my rights
* @description (x_x)
* @include http://*
* @include https://*
* @contributor yuta25 http://let.hatelabo.jp/yuta25/let/hLHWnL_HmJof
* @license MIT License
* @javascript_url
*/
(function() {
Array.prototype.forEach.call(document.querySelectorAll('*'), function(node) {
node.getAttribute('unselectable') && node.setAttribute('unselectable', 'off');
node.onmousedown = null;
node.oncontextmenu = null;
node.onselectstart = null;
//node.onselect = null;
node.oncopy = null;
node.oncut = null;
[
'',
//'-moz-', // *1
'-webkit-',
'-khtml-',
'-ms-',
'-o-'
].forEach(function(prefix) {
node.style[prefix + 'user-select'] = 'initial';
});
// *1: Fx can not access by indexer; node['-moz-user-select']
// e.g. http://www.softel.co.jp/blogs/tech/archives/2909
// property works well
node.style.MozUserSelect && (node.style.MozUserSelect = 'initial');
});
if (window.jQuery) {
jQuery('*').unbind();
}
}());
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。