view rakuten-books-direct-search.user.js @ 66:444b17e657be

Standardize code style
author nanaya <me@nanaya.pro>
date Wed, 10 Jul 2019 22:36:31 +0900
parents 72ef6fcdff44
children 521dda0a0b6f
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==

/* global jQuery */
;(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()