changeset 50:e8517cc75a74

Add https, update coding style
author nanaya <me@nanaya.pro>
date Fri, 13 Oct 2017 02:40:23 +0900
parents 2e1cae72a63e
children f0d5a5d80bfd
files jiku-chu-direct-link.user.js
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/jiku-chu-direct-link.user.js	Thu Oct 12 16:40:13 2017 +0900
+++ b/jiku-chu-direct-link.user.js	Fri Oct 13 02:40:23 2017 +0900
@@ -1,24 +1,25 @@
 // ==UserScript==
 // @name         Jiku-Chu direct link
 // @namespace    https://myconan.net
-// @version      2.5.1
+// @version      2.5.2
 // @description  Make proper link on Jiku-Chu pages
 // @author       nanaya
 // @match        http://www.jiku-chu.com/*
+// @match        https://www.jiku-chu.com/*
 // @grant        none
 // @downloadURL  https://bitbucket.org/!api/2.0/snippets/nanayapro/TK64/tip/files/jiku-chu-direct-link.user.js
 // ==/UserScript==
 
-;(function() {
-  "use strict";
-  var links = document.querySelectorAll("a[onclick^=\"age_verification_submit('/products/detail.php?product_id=\"]");
-  var removeOnClick = function(el) {
-    var productId = el.getAttribute("onclick").replace(/.*product_id=(\d+).*/, "$1");
-    var url = "/products/detail.php?product_id=" + productId;
+;(function () {
+  'use strict';
+  const links = document.querySelectorAll("a[onclick^=\"age_verification_submit('/products/detail.php?product_id=\"]");
+  const removeOnClick = function (el) {
+    const productId = el.getAttribute('onclick').replace(/.*product_id=(\d+).*/, '$1');
+    const url = `/products/detail.php?product_id=${productId}`;
 
-    el.setAttribute("href", url);
-    el.setAttribute("onclick", "");
+    el.setAttribute('href', url);
+    el.setAttribute('onclick', '');
   };
 
   Array.prototype.forEach.call(links, removeOnClick);
-}).call();
\ No newline at end of file
+}());