Method and device for controlling pop-up window, electronic device, and storage medium
View Patent ↗A method for controlling a pop-up window includes acquiring pop-up window configuration information that includes a pop-up window restriction condition. The method includes acquiring a pop-up window set that includes at least one pop-up window array, where each pop-up window array includes corresponding pop-up window information and a pop-up window page; acquiring a target page and traversing the pop-up window set. The target page is a page on which pop-up window control is performed, and the pop-up window page corresponding to the pop-up window array in the pop-up window set corresponds to the target page. The method includes controlling display of the pop-up window according to a relationship between the pop-up window information corresponding to the pop-up window array and the pop-up window restriction condition and matching between the pop-up window page corresponding to the pop-up window array and the target page.
1. A method for controlling a pop-up window, comprising:
acquiring pop-up window configuration information that comprises a pop-up window restriction condition, the pop-up window restriction condition comprising a maximum number of times of popping up for each pop-up window array within a preset time period;
acquiring a pop-up window set that comprises at least one pop-up window array, where each of the at least one pop-up window array comprises corresponding pop-up window information and a pop-up window page, and the pop-up window information comprises a number of times of popping up for the pop-up window array in the preset time period;
acquiring a target page and traversing the pop-up window set, wherein the target page is a page on which pop-up window control is performed, and the pop-up window page corresponding to the pop-up window array in the pop-up window set corresponds to the target page; and
determining, in response to the number of times of popping up for the pop-up window array within the preset time period is greater than or equal to the maximum number of times of popping up, that the pop-up window information corresponding to the pop-up window array does not meet the pop-up window restriction condition, and controlling the pop-up window not to be displayed.
2. The method according to claim 1 , wherein each pop-up window array comprises corresponding pop-up window content, and the method further comprises:
displaying the pop-up window on the target page based on the pop-up window content corresponding to the pop-up window array, in response to determining that the pop-up window information corresponding to the pop-up window array meets the pop-up window restriction condition and the pop-up window page corresponding to the pop-up window array matches the target page.
3. The method according to claim 2 , wherein the displaying the pop-up window on the target page based on the pop-up window content corresponding to the pop-up window array comprises:
generating a pop-up window message based on the pop-up window content corresponding to the pop-up window array; and
displaying a corresponding pop-up window on the target page according to the pop-up window message.
4. The method according to claim 3 , wherein the pop-up window restriction condition comprises a caching duration of the pop-up window configuration information, and
wherein after displaying the corresponding pop-up window on the target page according to the pop-up window message, the method comprises:
generating a notification of a processed pop-up window in response to an instruction received on the pop-up window;
returning to acquiring the target page and traversing the pop-up window set within the caching duration according to the notification; and
returning to acquiring the pop-up window configuration information after the caching duration according to the notification.
5. The method according to claim 1 , wherein prior to determining the pop-up window information corresponding to the pop-up window array does not meet the pop-up window restriction condition, and controlling the pop-up window not to be displayed, the method comprises:
detecting the matching between the pop-up window page corresponding to the pop-up window array and the target page.
6. The method according to claim 5 , wherein the detecting the matching between the pop-up window page corresponding to the pop-up window array and the target page comprises:
determining that the pop-up window page corresponding to the pop-up window array matches the target page in response to determining that the pop-up window page corresponding to the pop-up window array is consistent with the target page; and
determining that the pop-up window page corresponding to the pop-up window array does not match the target page in response to determining that the pop-up window page corresponding to the pop-up window array is inconsistent with the target page.
7. The method according to claim 1 , wherein the pop-up window restriction condition further comprises the maximum number of times of popping up for each pop-up window array on each pop-up window page within a preset time period.
8. The method according to claim 7 , wherein the maximum number of times of popping up for each pop-up window array is 1.
9. An electronic device, comprising:
a processor; and
a memory for storing instructions executable by the processor,
wherein the processor is configured to execute the instructions to perform a method for controlling a pop-up window, the method comprising:
acquiring pop-up window configuration information that comprises a pop-up window restriction condition, the pop-up window restriction condition comprising a maximum number of times of popping up for each pop-up window array within a preset time period;
acquiring a pop-up window set that comprises at least one pop-up window array, where each of the at least one pop-up window array comprises corresponding pop-up window information and a pop-up window page, and the pop-up window information comprises a number of times of popping up for the pop-up window array in the preset time period;
acquiring a target page and traversing the pop-up window set, wherein the target page is a page on which pop-up window control is performed, and the pop-up window page corresponding to the pop-up window array in the pop-up window set corresponds to the target page; and
determining, in response to the number of times of popping up for the pop-up window array within the preset time period is greater than or equal to the maximum number of times of popping up, that the pop-up window information corresponding to the pop-up window array does not meet the pop-up window restriction condition, and controlling the pop-up window not to be displayed.
10. The electronic device according to claim 9 , wherein each pop-up window array comprises corresponding pop-up window content, and the method further comprises:
displaying the pop-up window on the target page based on the pop-up window content corresponding to the pop-up window array, in response to determining that the pop-up window information corresponding to the pop-up window array meets the pop-up window restriction condition and the pop-up window page corresponding to the pop-up window array matches the target page.
11. The electronic device according to claim 10 , wherein the displaying the pop-up window on the target page based on the pop-up window content corresponding to the pop-up window array comprises:
generating a pop-up window message based on the pop-up window content corresponding to the pop-up window array; and
displaying a corresponding pop-up window on the target page according to the pop-up window message.
12. The electronic device according to claim 11 , wherein the pop-up window restriction condition comprises a caching duration of the pop-up window configuration information, and
wherein after displaying the corresponding pop-up window on the target page according to the pop-up window message, the method comprises:
generating a notification of a processed pop-up window in response to an instruction received on the pop-up window;
returning to acquiring the target page and traversing the pop-up window set within the caching duration according to the notification; and
returning to acquiring the pop-up window configuration information after the caching duration according to the notification.
13. The electronic device according to claim 9 , wherein prior to determining the pop-up window information corresponding to the pop-up window array does not meet the pop-up window restriction condition, and controlling the pop-up window not to be displayed, the method comprises:
detecting the matching between the pop-up window page corresponding to the pop-up window array and the target page.
14. The electronic device according to claim 13 , wherein said detecting the matching between the pop-up window page corresponding to the pop-up window array and the target page comprises:
determining that the pop-up window page corresponding to the pop-up window array matches the target page in response to determining that the pop-up window page corresponding to the pop-up window array is consistent with the target page; and
determining that the pop-up window page corresponding to the pop-up window array does not match the target page in response to determining that the pop-up window page corresponding to the pop-up window array is inconsistent with the target page.
15. The electronic device according to claim 9 , wherein the pop-up window restriction condition further comprises the maximum number of times of popping up for each pop-up window array on each pop-up window page within a preset time period.
16. The electronic device according to claim 15 , wherein the maximum number of times of popping up for each pop-up window array is 1.
17. A non-transitory computer-readable storage medium having stored there on instructions which, when being executed by a processor of an electronic device, cause the electronic device to perform a method for controlling the pop-up window, the method comprising:
acquiring pop-up window configuration information that comprises a pop-up window restriction condition, the pop-up window restriction condition comprising a maximum number of times of popping up for each pop-up window array within a preset time period;
acquiring a pop-up window set that comprises at least one pop-up window array, where each of the at least one pop-up window array comprises corresponding pop-up window information and a pop-up window page, and the pop-up window information comprises a number of times of popping up for the pop-up window array in the preset time period;
acquiring a target page and traversing the pop-up window set, wherein the target page is a page on which pop-up window control is performed, and the pop-up window page corresponding to the pop-up window array in the pop-up window set corresponds to the target page; and
determining, in response to the number of times of popping up for the pop-up window array within the preset time period is greater than or equal to the maximum number of times of popping up, that the pop-up window information corresponding to the pop-up window array does not meet the pop-up window restriction condition, and controlling the pop-up window not to be displayed.