comparison rakuten-books-direct-search.user.js @ 109:ef21ef445fc6

Cleanups - wrap everything in function and call them last - fix namespace and update url
author nanaya <me@nanaya.net>
date Sun, 15 Jan 2023 23:33:41 +0900
parents 2c4470b73ad9
children d9dc190bccaf
comparison
equal deleted inserted replaced
108:2c4470b73ad9 109:ef21ef445fc6
1 // ==UserScript== 1 // ==UserScript==
2 // @name rakuten books direct search 2 // @name rakuten books direct search
3 // @namespace https://myconan.net 3 // @namespace https://nanaya.net
4 // @version 1.0.6 4 // @version 1.0.6
5 // @description Search on rakuten without tracking proxy 5 // @description Search on rakuten without tracking proxy
6 // @author nanaya 6 // @author nanaya
7 // @match https://books.rakuten.co.jp/* 7 // @match https://books.rakuten.co.jp/*
8 // @match http://books.rakuten.co.jp/* 8 // @match http://books.rakuten.co.jp/*
9 // @match https://*.books.rakuten.co.jp/* 9 // @match https://*.books.rakuten.co.jp/*
10 // @match http://*.books.rakuten.co.jp/* 10 // @match http://*.books.rakuten.co.jp/*
11 // @grant none 11 // @grant none
12 // @downloadURL https://hg.myconan.net/ec-userscripts/raw-file/tip/rakuten-books-direct-search.user.js 12 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/rakuten-books-direct-search.user.js
13 // ==/UserScript== 13 // ==/UserScript==
14 14
15 'use strict';
16
15 /* global jQuery */ 17 /* global jQuery */
16 (function () { 18 function noTrackSearch () {
17 'use strict';
18
19 const $ = jQuery; 19 const $ = jQuery;
20 const $form = $("form[name='srchFrm']"); 20 const $form = $("form[name='srchFrm']");
21 21
22 if (!$form.length) { return; } 22 if (!$form.length) { return; }
23 23
24 const searchUrl = $form.find("input[name='R2']").attr('value'); 24 const searchUrl = $form.find("input[name='R2']").attr('value');
25 $form.attr('action', searchUrl); 25 $form.attr('action', searchUrl);
26 }).call(); 26 }
27
28 noTrackSearch();