diamond.jp redirect to print page
@@ -1,19 +1,22 @@
/*
* @title diamond.jp redirect to print page
+ * @description print view on diamond.jp
* @include http://diamond.jp/articles/-/*
* @contributor taizooo http://let.hatelabo.jp/taizooo/let/hLHUksb6l-tU (Fork of)
- * @contributor noromanba
+ * @license Unknown (as-is)
+ * @contributor noromanba http://let.hatelabo.jp/noromanba/let/hJmcqt7EtKkq
+ * @license MIT License http://opensource.org/licenses/MIT (patch-part)
*/
(function () {
- var a, b, c;
- a = location.pathname.split('/');
- b = a.map(function (x) {
- return x.replace(/-/, 'print')
- });
- c = b.join('/');
- location.pathname = c;
+ /*
+ if (!/^http:\/\/diamond\.jp\/articles\/\-\/\d+/.test(location.href) ||
+ /^\/articles\/print/.test(location.pathname)) {
+ return;
+ }
+ //*/
+ location.pathname = location.pathname.split('/').
+ map(function (x) {
+ return x.replace(/-/, 'print');
+ }).join('/');
})();
-// supply ";" for avoid "SyntaxError: Unexpected identifier" when use as Bookmarklet
-// - Debuglet -> ok
-// - Bookmarklet -> ng, semicolon ploblem on packed code
/*
* @title diamond.jp redirect to print page
* @description print view on diamond.jp
* @include http://diamond.jp/articles/-/*
* @contributor taizooo http://let.hatelabo.jp/taizooo/let/hLHUksb6l-tU (Fork of)
* @license Unknown (as-is)
* @contributor noromanba http://let.hatelabo.jp/noromanba/let/hJmcqt7EtKkq
* @license MIT License http://opensource.org/licenses/MIT (patch-part)
*/
(function () {
/*
if (!/^http:\/\/diamond\.jp\/articles\/\-\/\d+/.test(location.href) ||
/^\/articles\/print/.test(location.pathname)) {
return;
}
//*/
location.pathname = location.pathname.split('/').
map(function (x) {
return x.replace(/-/, 'print');
}).join('/');
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。