非特化妆品备案查询页

take it easy

// ==UserScript==
// @name         非特化妆品备案查询页
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  take it easy
// @author       You
// @match        https://hzpba.nmpa.gov.cn/gccx/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=nmpa.gov.cn
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    

    // Your code here...
    var d = document;
    var productName = d.querySelector('#prodName');
    var invCode = d.querySelector('#cont2');
    var queButton = d.querySelector('#searchInfo');
    var confButton = d.querySelector('#mb_btn_ok');
    var aView = d.querySelector('#planPreview');
    var bView = d.querySelector('#stgPreview');
    productName.tabIndex = 99;
    productName.focus();
    invCode.tabIndex = 100;

    document.onkeydown = function(e)
    {
        if(e.keyCode == '13')
        {
            queButton.click();
        }
    }

    if(document.location.href.indexOf('chakan')>0)
    {
        invCode.focus();
            document.onkeydown = function(e)
            {
                if(e.keyCode == '13')
                {
                    confButton.click();
                }
                else if(e.keyCode == '37')
                {
                    aView.click();
                }
                else if(e.keyCode == '39')
                {
                    bView.click();
                }

            }
    }

})();