Browser multi-tab switching method, device, equipment and storage medium
By obtaining and configuring the switching signal of the browser tab page, and switching the tab page periodically according to the configuration data input by the user, the problem of single tab page switching function in the existing technology is solved, and personalized browser tab page switching is realized, improving the Practicality.
Patent Information
- Application Number
- CN202210281735.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-03-21
AI Technical Summary
The automatic tab switching function of existing browsers is single, which cannot meet the user's personalized switching needs. The timed switching time is fixed and cannot be adjusted according to the user's specific needs.
By obtaining the multi-tag display start signal, obtaining the page switching configuration data, and periodically generate the tab switching signal based on the switching interval time in the data, allowing users to customize the switching frequency and time period through the configuration interface. Realize personalized switching of browser tabs.
The periodic tab page switching based on user configuration is realized to meet personalized needs. Users only need to modify the page switching configuration data, which improves practicality and does not need to modify the code.
Smart Images

Figure CN114595415B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of client technology, and in particular to a browser multi-tab switching method, device, equipment and storage medium. Background Art
[0002] The automatic tab switching function is generally used in large-screen browsers to display multiple pages. The browsers in the industry that can switch tabs at a scheduled time only implement the function of scheduled switching. The switching interval is hard-coded in the program, and the function is very simple, which cannot meet the user's personalized switching needs. Summary of the invention
[0003] The main purpose of the present application is to provide a browser multi-tab switching method, device, equipment and storage medium, aiming to solve the technical problem that the prior art of timed tab switching has a very single function and cannot meet the user's personalized switching needs.
[0004] In order to achieve the above-mentioned invention object, the present application proposes a method for switching multiple tabs of a browser, the method comprising:
[0005] Get the multi-tab display start signal;
[0006] In response to the multi-tab page display start signal, acquiring page switching configuration data, and using the generation time of the multi-tab page display start signal as the cycle start time;
[0007] Taking the periodic start time as the start time, periodically generating a tab switching signal according to the switching interval duration configured in the page switching configuration data;
[0008] Each of the tab switching signals is sent to a browser, so that the browser switches tabs according to the tab switching signal.
[0009] Furthermore, before the step of obtaining the page switching configuration data, the step further includes:
[0010] Get configuration start request;
[0011] In response to the configuration start request, a configuration interface is displayed using a preset configuration interface display method;
[0012] Acquiring the switching configuration data to be updated input by the user according to the configuration interface;
[0013] Replace and update the page switching configuration data in the local storage space with the switching configuration data to be updated;
[0014] The switching configuration data to be updated is sent to the browser.
[0015] Furthermore, the step of periodically generating a tab switching signal with the periodic start time as the start time and configuring the switching interval duration in the page switching configuration data includes:
[0016] Determine whether the current time is within the switching time period configuration in the page switching configuration data;
[0017] If it is, generating a first timer according to the switching time period configuration, taking the period start time as the start time and the triggering of the first timer as the end time, periodically generating the tab switching signal according to the switching interval duration configuration, and when the first timer is triggered, determining that the current time is not within the switching time period configuration;
[0018] If not, the step of determining whether the current time is within the switching time period configuration in the page switching configuration data is repeatedly performed at intervals of a preset first time length.
[0019] Furthermore, after the step of using the generation time of the multi-tab page display start signal as the cycle start time, the method further includes:
[0020] Taking the cycle start time as the start time, periodically generating a tab page refresh signal according to the refresh interval duration configured in the page switching configuration data;
[0021] The tab page refresh signal is sent to the browser, wherein the browser is further used to: obtain information of all the tab pages that are currently opened according to the tab page refresh signal, and perform tab page refresh according to the information of all the tab pages that are currently opened.
[0022] Furthermore, the step of periodically generating a tab refresh signal with the cycle start time as the start time and configuring the refresh interval duration in the page switching configuration data includes:
[0023] Determine whether the current time is within the refresh time period configuration in the page switching configuration data;
[0024] If it is, generating a second timer according to the refresh time period configuration, taking the period start time as the start time and the triggering of the second timer as the end time, periodically generating the tab refresh signal according to the refresh interval duration configuration, and when the second timer is triggered, determining that the current time is not within the refresh time period configuration;
[0025] If not, the step of determining whether the current time is within the refresh time period configuration in the page switching configuration data is repeatedly performed at intervals of a preset second time length.
[0026] Furthermore, after the step of using the generation time of the multi-tab page display start signal as the cycle start time, the method further includes:
[0027] Taking the cycle start time as the start time, periodically generating a browser restart signal according to the browser restart interval duration configured in the page switching configuration data;
[0028] The browser restart signal is sent to the browser, wherein the browser is further used to: obtain information of all the currently opened tab pages according to the browser restart signal, and restart according to the information of all the currently opened tab pages.
[0029] Furthermore, the step of periodically generating a browser restart signal with the cycle start time as the start time and configuring the browser restart interval in the page switching configuration data includes:
[0030] Determine whether the current time is within the restart time period configuration in the page switching configuration data;
[0031] If it is, generating a third timer according to the restart time period configuration, taking the period start time as the start time and the triggering of the third timer as the end time, periodically generating the browser restart signal according to the browser restart interval configuration, and when the third timer is triggered, determining that the current time is not within the restart time period configuration;
[0032] If not, the step of determining whether the current time is within the restart time period configuration in the page switching configuration data is repeatedly performed at intervals of a preset third time length.
[0033] The present application also proposes a browser multi-tab switching device, the device comprising:
[0034] The signal acquisition module is used to obtain the multi-tab display start signal;
[0035] A data acquisition module, used to respond to the multi-tab page display start signal, acquire page switching configuration data, and use the generation time of the multi-tab page display start signal as the cycle start time;
[0036] A tab switching signal generating module, configured to periodically generate a tab switching signal with the periodic start time as the start time and according to the switching interval duration configured in the page switching configuration data;
[0037] The tab switching module is used to send each of the tab switching signals to the browser, so that the browser switches the tabs according to the tab switching signal.
[0038] The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0039] The present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0040] The browser multi-tab switching method, device, equipment and storage medium of the present application, wherein the method obtains a multi-tab display start signal; in response to the multi-tab display start signal, obtains page switching configuration data, and uses the generation time of the multi-tab display start signal as the cycle start time; uses the cycle start time as the start time, and periodically generates a tab switching signal according to the switching interval duration in the page switching configuration data; each of the tab switching signals is sent to the browser, so that the browser switches tabs according to the tab switching signal. Thus, the periodic switching of tabs in the browser based on the page switching configuration data is realized, and the personalized switching needs of users can be met through the page switching configuration data; and the modification needs only need to modify the page switching configuration data, without modifying the code, which improves practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A flowchart of a method for switching multiple tabs in a browser according to an embodiment of the present application;
[0042] Figure 2 A schematic block diagram of the structure of a browser multi-tab switching device according to an embodiment of the present application;
[0043] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.
[0044] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0046] Reference Figure 1 In an embodiment of the present application, a method for switching multiple tabs of a browser is provided, the method comprising:
[0047] S1: Get the multi-tab display start signal;
[0048] S2: Responding to the multi-tab page display start signal, acquiring page switching configuration data, and using the generation time of the multi-tab page display start signal as the cycle start time;
[0049] S3: taking the periodic start time as the start time, and periodically generating a tab switching signal according to the switching interval duration configured in the page switching configuration data;
[0050] S4: Send each of the tab switching signals to the browser, so that the browser switches the tabs according to the tab switching signal.
[0051] This embodiment implements periodic switching of tabs in the browser based on page switching configuration data. The page switching configuration data can meet the user's personalized switching needs. Moreover, to modify the needs, only the page switching configuration data needs to be modified, and no code needs to be modified, which improves practicality.
[0052] For S1, a multi-tab display start signal input by a user may be obtained, or a multi-tab display start signal sent by a browser may be obtained.
[0053] The multi-tab display start signal is the start signal for displaying multiple tabs in the same browser. For example, when the browser opens the second tab, the multi-tab display start signal is sent.
[0054] Optionally, based on a browser plug-in message interaction mechanism, the multi-tab page display start signal sent by the browser is obtained.
[0055] The plugin message interaction mechanism of the browser is completed through the message interaction between popup, background and content_scripts. Popup is the pop-up information. Background is the background. Content_scripts is the content script.
[0056] The browser includes but is not limited to: Chrome.
[0057] For S2, in response to the multi-tab display start signal, page switching configuration data is obtained from the local storage space, and the generation time of the multi-tab display start signal is used as the cycle start time, which provides a basis for generating a tab switching signal.
[0058] The page switching configuration data includes: switching interval configuration. The switching interval configuration refers to the interval between tab page switching. For example, if the switching interval configuration is set to 2 seconds, the tab page will be switched every 2 seconds.
[0059] For S3, the tab switching signal is periodically generated by taking the cycle start time as the start time of the first cycle and taking the switching interval duration configured in the page switching configuration data as the duration of each cycle.
[0060] That is to say, a tab switching signal is generated in each cycle, thereby enabling the browser to perform periodic tab switching.
[0061] Optionally, taking the cycle start time as the start time, a tab switching signal is periodically generated according to the switching interval duration in the page switching configuration data until a multi-tab end signal is obtained, wherein the multi-tab end signal includes: a single tab start signal or a browser closing signal.
[0062] For S4, based on the browser's plug-in message interaction mechanism, each of the tab switching signals is sent to the browser.
[0063] The step of the browser switching tabs according to the tab switching signal includes obtaining all the currently opened tab information according to the tab switching signal, obtaining the currently displayed tab identifier from all the currently opened tab information as the first tab identifier, obtaining the switched tab identifier from all the currently opened tab information as the second tab identifier according to the first tab identifier, and switching tabs according to the second tab identifier.
[0064] Among them, when the browser receives the tab switching signal, it will obtain all the currently opened tab information according to the tab switching signal, obtain the currently displayed tab identifier from all the currently opened tab information as the first tab identifier, and according to the first tab identifier, obtain the switched tab identifier from all the currently opened tab information as the second tab identifier, and switch the tab corresponding to the second tab identifier to the currently displayed tab.
[0065] It is understandable that switching tabs means switching the web pages that are already opened.
[0066] It can be understood that the method steps of the present application can be developed using JS (JavaScript) code, and the developed program can be encapsulated into a plug-in as a multi-tab switching plug-in; then in the browser's settings menu, the multi-tab switching plug-in can be loaded by loading the unpacked extension program, thereby introducing the multi-tab switching plug-in into the browser.
[0067] In one embodiment, before the step of obtaining the page switching configuration data, the step further includes:
[0068] S21: Get configuration start request;
[0069] S22: responding to the configuration start request, displaying the configuration interface in a preset configuration interface display manner;
[0070] S23: acquiring the switching configuration data to be updated input by the user according to the configuration interface;
[0071] S24: replacing and updating the page switching configuration data in the local storage space with the switching configuration data to be updated;
[0072] S25: Send the switching configuration data to be updated to the browser.
[0073] This embodiment obtains the to-be-updated switching configuration data input by the user according to the configuration interface to update the page switching configuration data, simplifies the configuration method, and the user can configure the to-be-updated switching configuration data without understanding the code, thereby improving practicality.
[0074] In S21, a configuration acquisition start request input by a user is acquired.
[0075] The configuration start request is a request to perform configuration.
[0076] For S22, when the configuration start request is received, the configuration interface is displayed using a preset configuration interface display method, and the user only needs to input configuration information in the configuration interface.
[0077] For S23, the user inputs configuration information in the configuration interface, and clicks the Submit button after input is completed; when the Submit button is clicked, the switching configuration data to be updated will be generated according to the configuration information in the configuration interface.
[0078] For S24, the page switching configuration data in the local storage space is replaced and updated with the switching configuration data to be updated, which provides a basis for the subsequent generation of a tab switching signal.
[0079] For S25, based on the browser's plug-in message interaction mechanism, the switching configuration data to be updated is sent to the browser.
[0080] In one embodiment, the step of periodically generating a tab switching signal with the periodic start time as the start time and configuring the switching interval duration in the page switching configuration data includes:
[0081] S31: Determine whether the current time is within the switching time period configuration in the page switching configuration data;
[0082] S32: If yes, generate a first timer according to the switching time period configuration, take the period start time as the start time and the triggering of the first timer as the end time, periodically generate the tab switching signal according to the switching interval duration configuration, and when the first timer is triggered, determine that the current time is not within the switching time period configuration;
[0083] S33: If not, repeating the step of determining whether the current time is within the switching time period configured in the page switching configuration data at intervals of a preset first time length.
[0084] This embodiment controls the time period during which tab switching can be performed by configuring the switching time period, and controls the frequency of tab switching by configuring the switching interval duration, thereby meeting the personalized switching needs of users.
[0085] For S31, it is determined whether the current time is within the switching time period configuration in the page switching configuration data, thereby providing a basis for controlling the time period in which tab switching can be performed.
[0086] The switching time period configuration includes: switching time range. The switching time range includes the start time and the end time.
[0087] For S32, if it is located, that is, the current time is located within the switching time period configuration in the page switching configuration data, it means that tab switching can be performed. Therefore, a timer is generated as the first timer according to the switching time period configuration, with the cycle start time as the start time of the first cycle, and the tab switching signal is periodically generated according to the switching interval duration configuration until the trigger signal of the first timer is obtained; when the first timer is triggered, it is determined that the current time is not located within the switching time period configuration, thereby providing a basis for repeatedly executing the step of determining whether the current time is located within the switching time period configuration in the page switching configuration data at an interval preset first duration.
[0088] For S33, if it is not located, that is, the current time is not within the switching time period configuration in the page switching configuration data, it means that there is no need to switch tabs. Therefore, steps S31 to S33 are repeated at the first preset time interval to determine whether the time period for tab switching has been entered.
[0089] In one embodiment, after the step of using the generation time of the multi-tab page display start signal as the cycle start time, the method further includes:
[0090] S51: taking the periodic start time as the start time, and periodically generating a tab page refresh signal according to the refresh interval duration in the page switching configuration data;
[0091] S52: Sending the tab page refresh signal to the browser, wherein the browser is further used to: obtain information of all the tab pages currently opened according to the tab page refresh signal, and perform tab page refresh according to the information of all the tab pages currently opened.
[0092] When the network is unstable, page network anomalies often occur. If the page cannot be refreshed, it will always display an incorrect display, which is obviously not what the user wants to see. In order to solve this problem, this embodiment uses the cycle start time as the start time, and periodically generates a tab refresh signal according to the refresh interval duration in the page switching configuration data, thereby realizing timed refresh of the tabs in the browser, meeting the user's personalized tab refresh needs, and improving the user experience.
[0093] For S51, the tab page refresh signal is periodically generated by taking the cycle start time as the start time of the first cycle and taking the refresh interval duration configuration as the duration of each cycle.
[0094] For S52, based on the browser's plug-in message interaction mechanism, the tab refresh signal is sent to the browser, wherein the browser finds out all the tab information currently opened, and refreshes each tab with a loading error corresponding to all the tab information currently opened.
[0095] Optionally, the step of refreshing the tabs according to all the tab information that are currently opened includes: obtaining each tab information with a loading error from all the tab information that are currently opened as the tab information to be refreshed, and refreshing the tabs corresponding to each tab information to be refreshed.
[0096] In one embodiment, the step of periodically generating a tab refresh signal with the cycle start time as the start time and configuring the refresh interval duration in the page switching configuration data includes:
[0097] S511: Determine whether the current time is within the refresh time period configuration in the page switching configuration data;
[0098] S512: If yes, generate a second timer according to the refresh time period configuration, take the period start time as the start time and the triggering of the second timer as the end time, periodically generate the tab refresh signal according to the refresh interval duration configuration, and when the second timer is triggered, determine that the current time is not within the refresh time period configuration;
[0099] S513: If not, repeating the step of determining whether the current time is within the refresh time period configured in the page switching configuration data at intervals of a preset second time length.
[0100] In this embodiment, the time period during which the tab page can be refreshed is controlled by configuring the refresh time period, and the frequency of the tab page refresh is controlled by configuring the refresh interval duration, thereby meeting the user's personalized tab page refresh requirements.
[0101] For S511, it is determined whether the current time is within the refresh time period configuration in the page switching configuration data, thereby providing a basis for controlling the time period in which the tab page can be refreshed.
[0102] The refresh time range configuration includes: refresh time range. The refresh time range includes the start time and the end time.
[0103] For S512, if it is located, that is, the current time is located within the refresh time period configuration in the page switching configuration data, it means that the tab refresh can be performed. Therefore, a timer is generated as a second timer according to the refresh time period configuration, and the cycle start time is used as the start time of the first cycle. The tab refresh signal is periodically generated according to the refresh interval duration configuration until the trigger signal of the second timer is obtained; when the second timer is triggered, it is determined that the current time is not located within the refresh time period configuration, thereby providing a basis for repeatedly executing the step of determining whether the current time is located within the refresh time period configuration in the page switching configuration data at an interval preset second duration.
[0104] For S513, if it is not located, that is, the current time is not within the refresh time period configuration in the page switching configuration data, it means that there is no need to refresh the tab. Therefore, steps S511 to S513 are repeated at a second preset time interval to determine whether the tab refresh time period has been entered.
[0105] In one embodiment, after the step of using the generation time of the multi-tab page display start signal as the cycle start time, the method further includes:
[0106] S61: taking the periodic start time as the start time, periodically generating a browser restart signal according to the browser restart interval time configured in the page switching configuration data;
[0107] S62: Sending the browser restart signal to the browser, wherein the browser is further used to: obtain information of all the currently opened tab pages according to the browser restart signal, and restart according to the information of all the currently opened tab pages.
[0108] When there are too many tabs and the switching time is too long, it may cause browser load problems. In order to solve this problem, this embodiment takes the cycle start time as the start time, and periodically generates a browser restart signal according to the browser restart interval duration in the page switching configuration data, thereby realizing the timed restart of the browser and the timed release of the browser's memory, ensuring normal switching of tabs.
[0109] For S61, the browser restart signal is periodically generated by taking the cycle start time as the start time of the first cycle and the browser restart interval configuration as the duration of each cycle.
[0110] For S62, based on the browser's plug-in message interaction mechanism, the browser restart signal is sent to the browser, wherein the browser finds out all the tab information currently opened as the restart tab information, and then restarts, and immediately loads each tab corresponding to the restart tab information after restarting.
[0111] In one embodiment, the step of periodically generating a browser restart signal with the cycle start time as the start time and configuring the browser restart interval in the page switching configuration data includes:
[0112] S611: Determine whether the current time is within the restart time period configuration in the page switching configuration data;
[0113] S612: If yes, generate a third timer according to the restart time period configuration, take the period start time as the start time and the triggering of the third timer as the end time, periodically generate the browser restart signal according to the browser restart interval configuration, and when the third timer is triggered, determine that the current time is not within the restart time period configuration;
[0114] S613: If not, repeating the step of determining whether the current time is within the restart time period configuration in the page switching configuration data at intervals of a preset third time length.
[0115] This embodiment controls the time period during which the browser can be restarted by configuring the restart time period, and controls the frequency of browser restarts by configuring the browser restart interval duration, thereby meeting the user's personalized browser restart requirements.
[0116] For S611, it is determined whether the current time is within the restart time period configuration in the page switching configuration data, thereby providing a basis for controlling the time period in which the browser can be restarted.
[0117] The restart time range configuration includes: restart time range. The restart time range includes the start time and the end time.
[0118] For S612, if it is located, that is, the current time is located within the restart time period configuration in the page switching configuration data, it means that the browser can be restarted. Therefore, a timer is generated as a third timer according to the restart time period configuration, with the cycle start time as the start time of the first cycle, and the browser restart signal is periodically generated according to the browser restart interval configuration until a trigger signal of the third timer is obtained; when the third timer is triggered, it is determined that the current time is not within the restart time period configuration, thereby providing a basis for repeatedly executing the step of determining whether the current time is within the restart time period configuration in the page switching configuration data at an interval of the preset third time period.
[0119] For S613, if it is not located, that is, the current time is not within the restart time period configuration in the page switching configuration data, it means that there is no need to restart the browser. Therefore, steps S611 to S613 are repeated at a third preset interval to determine whether the browser restart time period has been entered.
[0120] Reference Figure 2 The present application also proposes a browser multi-tab switching device, the device comprising:
[0121] A signal acquisition module 100 is used to acquire a multi-tab display start signal;
[0122] The data acquisition module 200 is used to respond to the multi-tab page display start signal, acquire page switching configuration data, and use the generation time of the multi-tab page display start signal as the cycle start time;
[0123] The tab switching signal generating module 300 is used to periodically generate a tab switching signal with the period starting time as the starting time and according to the switching interval time length configuration in the page switching configuration data;
[0124] The tab switching module 400 is used to send each of the tab switching signals to the browser, so that the browser switches the tabs according to the tab switching signal.
[0125] This embodiment implements periodic switching of tabs in the browser based on page switching configuration data. The page switching configuration data can meet the user's personalized switching needs. Moreover, to modify the needs, only the page switching configuration data needs to be modified, and no code needs to be modified, which improves practicality.
[0126] In one embodiment, before the step of obtaining the page switching configuration data, the step further includes:
[0127] Get configuration start request;
[0128] In response to the configuration start request, a configuration interface is displayed using a preset configuration interface display method;
[0129] Acquiring the switching configuration data to be updated input by the user according to the configuration interface;
[0130] Replace and update the page switching configuration data in the local storage space with the switching configuration data to be updated;
[0131] The switching configuration data to be updated is sent to the browser.
[0132] In one embodiment, the step of periodically generating a tab switching signal with the periodic start time as the start time and configuring the switching interval duration in the page switching configuration data includes:
[0133] Determine whether the current time is within the switching time period configuration in the page switching configuration data;
[0134] If it is, generating a first timer according to the switching time period configuration, taking the period start time as the start time and the triggering of the first timer as the end time, periodically generating the tab switching signal according to the switching interval duration configuration, and when the first timer is triggered, determining that the current time is not within the switching time period configuration;
[0135] If not, the step of determining whether the current time is within the switching time period configuration in the page switching configuration data is repeatedly performed at intervals of a preset first time length.
[0136] In one embodiment, after the step of using the generation time of the multi-tab page display start signal as the cycle start time, the method further includes:
[0137] Taking the cycle start time as the start time, periodically generating a tab page refresh signal according to the refresh interval duration configured in the page switching configuration data;
[0138] The tab page refresh signal is sent to the browser, wherein the browser is further used to: obtain information of all the tab pages that are currently opened according to the tab page refresh signal, and perform tab page refresh according to the information of all the tab pages that are currently opened.
[0139] In one embodiment, the step of periodically generating a tab refresh signal with the cycle start time as the start time and configuring the refresh interval duration in the page switching configuration data includes:
[0140] Determine whether the current time is within the refresh time period configuration in the page switching configuration data;
[0141] If it is, generating a second timer according to the refresh time period configuration, taking the period start time as the start time and the triggering of the second timer as the end time, periodically generating the tab refresh signal according to the refresh interval duration configuration, and when the second timer is triggered, determining that the current time is not within the refresh time period configuration;
[0142] If not, the step of determining whether the current time is within the refresh time period configuration in the page switching configuration data is repeatedly performed at intervals of a preset second time length.
[0143] In one embodiment, after the step of using the generation time of the multi-tab page display start signal as the cycle start time, the method further includes:
[0144] Taking the cycle start time as the start time, periodically generating a browser restart signal according to the browser restart interval duration configured in the page switching configuration data;
[0145] The browser restart signal is sent to the browser, wherein the browser is further used to: obtain information of all the currently opened tab pages according to the browser restart signal, and restart according to the information of all the currently opened tab pages.
[0146] In one embodiment, the step of periodically generating a browser restart signal with the cycle start time as the start time and configuring the browser restart interval in the page switching configuration data includes:
[0147] Determine whether the current time is within the restart time period configuration in the page switching configuration data;
[0148] If it is, generating a third timer according to the restart time period configuration, taking the period start time as the start time and the triggering of the third timer as the end time, periodically generating the browser restart signal according to the browser restart interval configuration, and when the third timer is triggered, determining that the current time is not within the restart time period configuration;
[0149] If not, the step of determining whether the current time is within the restart time period configuration in the page switching configuration data is repeatedly performed at intervals of a preset third time length.
[0150] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a browser multi-tab switching method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a browser multi-tab switching method is implemented. The browser multi-tab switching method includes: obtaining a multi-tab display start signal; responding to the multi-tab display start signal, obtaining page switching configuration data, and using the generation time of the multi-tab display start signal as the cycle start time; using the cycle start time as the start time, periodically generating a tab switching signal according to the switching interval duration in the page switching configuration data; sending each of the tab switching signals to the browser, so that the browser switches tabs according to the tab switching signal.
[0151] This embodiment implements periodic switching of tabs in the browser based on page switching configuration data. The page switching configuration data can meet the user's personalized switching needs. Moreover, to modify the needs, only the page switching configuration data needs to be modified, and no code needs to be modified, which improves practicality.
[0152] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a method for switching multiple tabs of a browser is implemented, comprising the steps of: obtaining a multi-tab display start signal; in response to the multi-tab display start signal, obtaining page switching configuration data, and using the generation time of the multi-tab display start signal as the cycle start time; using the cycle start time as the start time, and periodically generating a tab switching signal according to the switching interval duration in the page switching configuration data; and sending each of the tab switching signals to a browser so that the browser switches tabs according to the tab switching signal.
[0153] The above-mentioned browser multi-tab switching method realizes the periodic switching of tabs in the browser based on the page switching configuration data. The page switching configuration data can meet the user's personalized switching needs; and to modify the needs, only the page switching configuration data needs to be modified, without modifying the code, which improves practicality.
[0154] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0155] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0156] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for switching multiple tabs of a browser, characterized in that: The method comprises: Get the multi-tab display start signal; In response to the multi-tab page display start signal, obtain page switching configuration data, and use the generation time of the multi-tab page display start signal as the cycle start time; Taking the periodic start time as the start time, periodically generating a tab switching signal according to the switching interval duration configured in the page switching configuration data; Sending each of the tab switching signals to a browser, so that the browser switches tabs according to the tab switching signal; Before the step of obtaining the page switching configuration data, the method further includes: Get configuration start request; In response to the configuration start request, a configuration interface is displayed using a preset configuration interface display method; Acquiring the switching configuration data to be updated input by the user according to the configuration interface; Replace and update the page switching configuration data in the local storage space with the switching configuration data to be updated; Sending the switching configuration data to be updated to the browser; The step of periodically generating a tab switching signal with the periodic start time as the start time and configuring the switching interval duration in the page switching configuration data includes: Determine whether the current time is within the switching time period configuration in the page switching configuration data; If it is, generating a first timer according to the switching time period configuration, taking the period start time as the start time and the triggering of the first timer as the end time, periodically generating the tab switching signal according to the switching interval duration configuration, and when the first timer is triggered, determining that the current time is not within the switching time period configuration; If not, the step of determining whether the current time is within the switching time period configuration in the page switching configuration data is repeatedly performed at intervals of a preset first time length.
2. The browser multi-tab switching method according to claim 1, characterized in that: After the step of using the generation time of the multi-tab page display start signal as the cycle start time, the method further includes: Taking the cycle start time as the start time, periodically generating a tab page refresh signal according to the refresh interval duration configured in the page switching configuration data; The tab page refresh signal is sent to the browser, wherein the browser is further used to: obtain information of all the tab pages that are currently opened according to the tab page refresh signal, and perform tab page refresh according to the information of all the tab pages that are currently opened.
3. The browser multi-tab switching method according to claim 2, characterized in that: The step of taking the periodic start time as the start time and configuring the periodic generation of the tab refresh signal according to the refresh interval duration in the page switching configuration data comprises: Determine whether the current time is within the refresh time period configuration in the page switching configuration data; If it is, generating a second timer according to the refresh time period configuration, taking the period start time as the start time and the triggering of the second timer as the end time, periodically generating the tab refresh signal according to the refresh interval duration configuration, and when the second timer is triggered, determining that the current time is not within the refresh time period configuration; If not, the step of determining whether the current time is within the refresh time period configuration in the page switching configuration data is repeatedly performed at intervals of a preset second time length.
4. The browser multi-tab switching method according to claim 1, characterized in that: After the step of using the generation time of the multi-tab page display start signal as the cycle start time, the method further includes: Taking the cycle start time as the start time, periodically generating a browser restart signal according to the browser restart interval duration configured in the page switching configuration data; The browser restart signal is sent to the browser, wherein the browser is further used to: obtain information of all the currently opened tab pages according to the browser restart signal, and restart according to the information of all the currently opened tab pages.
5. The browser multi-tab switching method according to claim 4, characterized in that: The step of taking the cycle start time as the start time and configuring the periodic generation of the browser restart signal according to the browser restart interval in the page switching configuration data comprises: Determine whether the current time is within the restart time period configuration in the page switching configuration data; If it is, generating a third timer according to the restart time period configuration, taking the period start time as the start time and the triggering of the third timer as the end time, periodically generating the browser restart signal according to the browser restart interval configuration, and when the third timer is triggered, determining that the current time is not within the restart time period configuration; If not, the step of determining whether the current time is within the restart time period configuration in the page switching configuration data is repeatedly performed at intervals of a preset third time length.
6. A browser multi-tab switching device, characterized in that: The device is used to implement the browser multi-tab switching method according to any one of claims 1 to 5, comprising: The signal acquisition module is used to obtain the multi-tab display start signal; A data acquisition module, used to respond to the multi-tab page display start signal, acquire page switching configuration data, and use the generation time of the multi-tab page display start signal as the cycle start time; A tab switching signal generating module, configured to periodically generate a tab switching signal with the periodic start time as the start time and according to the switching interval duration configured in the page switching configuration data; The tab switching module is used to send each of the tab switching signals to the browser, so that the browser switches the tabs according to the tab switching signal.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
