view rakuten-books-direct-search.user.js @ 65:72ef6fcdff44

Add missing strict
author nanaya <me@nanaya.pro>
date Wed, 10 Jul 2019 22:30:14 +0900
parents 3381a9cb88d1
children 444b17e657be
line wrap: on
line source

// ==UserScript==
// @name         rakuten books direct search
// @namespace    https://myconan.net
// @version      1.0.3
// @description  Search on rakuten without tracking proxy
// @author       nanaya
// @match        https://books.rakuten.co.jp/*
// @match        http://books.rakuten.co.jp/*
// @match        https://*.books.rakuten.co.jp/*
// @match        http://*.books.rakuten.co.jp/*
// @grant        none
// @downloadURL  https://bitbucket.org/nanayapro/ec-userscripts/raw/tip/rakuten-books-direct-search.user.js
// ==/UserScript==

;(function() {
  "use strict";

  var $ = jQuery;
  var $form = $("form[name='srchFrm']");

  if (!$form.length) { return; }

  var searchUrl = $form.find("input[name='R2']").attr("value");
  $form.attr("action", searchUrl);
}).call();