document.getElementById('import-cookies').addEventListener('click', () => {
            if (disableButtons) {
                return;
            }

            setPageTitle('Cookie Editor Plus - Import Cookies');

            disableButtons = true;
            Animate.transitionPage(containerCookie, containerCookie.firstChild, createHtmlFormImport(), 'left', () => {
                disableButtons = false;
            });

            document.getElementById('button-bar-default').classList.remove('active');
            document.getElementById('button-bar-import').classList.add('active');

            document.getElementById('content-import').focus();
            return false;
        });

        document.getElementById('return-list-add').addEventListener('click', () => {
            showCookiesForTab();
        });
        document.getElementById('return-list-import').addEventListener('click', () => {
            showCookiesForTab();
        });

        containerCookie.addEventListener('submit', e => {
            e.preventDefault();
            saveCookieForm(e.target);
            return false;
        });

        document.getElementById('save-create-cookie').addEventListener('click', () => {
            saveCookieForm(document.querySelector('form'));
        });

        document.getElementById('save-import-cookie').addEventListener('click', e => {
            let buttonIcon = document.getElementById('save-import-cookie').querySelector('use');
            if (buttonIcon.getAttribute("href") !== "../sprites/solid.svg#file-import") {
                return;
            }

            let json = document.querySelector('textarea').value;
            if (!json) {
                return;
            }
            let cookies;
            try {
                cookies = JSON.parse(json);
            } catch (error) {
                try {
                    let cookiesTmp = [];
                    // Json failed, let's try netscape format.
                    let lines = json.split('\n');
                    for (var line of lines) {
                        line = line.trim();
                        if (!line.length || line[0] == '#') {
                            continue;
                        }

                        const elements = line.split("\t");
                        if (elements.length != 7) {
                            throw new Error('Invalid netscape format')
                        }
                        cookiesTmp.push({
                            domain: elements[0],
                            path: elements[2],
                            secure: (elements[3].toLowerCase() === 'true'),
                            expiration: elements[4],
                            name: elements[5],
                            value: elements[6]
                        });
                    }
                    cookies = cookiesTmp;
                } catch (error) {
                    
                    sendNotification("Could not parse the value");
                    buttonIcon.setAttribute("href", "../sprites/solid.svg#times");
                    setTimeout(() => {
                        buttonIcon.setAttribute("href", "../sprites/solid.svg#file-import");
                    }, 1500);
                    return;
                }
            }

            if (!isArray(cookies)) {
                
                sendNotification("The input is not valid Json/Netscape format");
                buttonIcon.setAttribute("href", "../sprites/solid.svg#times");
                setTimeout(() => {
                    buttonIcon.setAttribute("href", "../sprites/solid.svg#file-import");
                }, 1500);
                return;
            }

            for (let cookie of cookies) {
                // Make sure we are using the right store ID. This is in case we are importing from a basic store ID and the
                // current user is using custom containers
                cookie.storeId = cookieHandler.currentTab.cookieStoreId;

                if (cookie.sameSite && cookie.sameSite === 'unspecified') {
                    cookie.sameSite = null;
                }

                try {
                    cookieHandler.saveCookie(cookie, getCurrentTabUrl(), function (error, cookie) {
                        if (error) {
                            sendNotification(error);
                        }
                    });
                } catch (error) {
                    
                }
            }

            sendNotification(`Cookies were imported`);
            showCookiesForTab();
        });

        document.querySelector('#advanced-toggle-all input').addEventListener('change', function() {
            showAllAdvanced = this.checked;
            browserDetector.getApi().storage.local.set({showAllAdvanced: showAllAdvanced});
            showCookiesForTab();
        });

        notificationElement.addEventListener('animationend', e => {
            if (notificationElement.classList.contains('fadeInUp')) {
                return;
            }

            triggerNotification();
        });

        document.getElementById('notification-dismiss').addEventListener('click', e => {
            hideNotification();
        });

        initWindow();
        showCookiesForTab();
        adjustWidthIfSmaller();

        if (chrome && chrome.runtime && chrome.runtime.getBrowserInfo) {
            chrome.runtime.getBrowserInfo(function (info) {
                const mainVersion = info.version.split('.')[0];
                if (mainVersion < 57) {
                    containerCookie.style.height = '600px';
                }
            });
        }

        // Bugfix/hotfix for Chrome 84. Let's remove this once Chrome 90 or later is released
        if (browserDetector.isChrome()) {
            
            document.querySelectorAll('svg').forEach(x => {x.innerHTML = x.innerHTML});
        }
    });

分析以上代码并修改：当点击import按钮时，自动导入当前文件夹下的1.json文件，并记录这个信息，如果是当前是1.json文件，就自动导入2.json文件，依次类推，如果找不到下一次json文件就重新导入1.json

请一次性给出修改后的完整代码