view rakuten-books-direct-search.user.js @ 59:3381a9cb88d1

White spaces and end of lines
author nanaya <me@nanaya.pro>
date Thu, 23 Aug 2018 22:58:33 +0900
parents 960d452dea99
children 72ef6fcdff44
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() {
  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();