Page processing method, device, equipment, storage medium and program product of subprogram

By loading page processing services into web applications and utilizing proxy services to obtain web page resources, the cross-domain issues and security threats of web page view pages are resolved, enabling secure rendering and operation of web applications.

CN122173308APending Publication Date: 2026-06-09TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2024-12-09
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

The rendering of web view pages in subroutines of web applications suffers from cross-domain issues and security threats, causing them to malfunction.

Method used

By loading a page processing service, a proxy service is used to obtain web page resources from a resource service, and the web page view is rendered in the page processing service. It is ensured that the domain name of the page processing service is different from the domain name of the web application to avoid network attacks and cross-domain restrictions.

Benefits of technology

It ensures the security of web applications and the normal rendering and operation of web page views, solves cross-domain issues, and guarantees the security of web applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173308A_ABST
    Figure CN122173308A_ABST
Patent Text Reader

Abstract

The application provides a subprogram page processing method and device, equipment, storage medium and program product; the method comprises the following steps: loading a page processing service for a web view page to be rendered of a subprogram, the subprogram runs in a web application, and the domain name of the page processing service is different from the domain name of the web application; sending a resource acquisition request to a proxy service through the page processing service, the resource acquisition request instructs the proxy service to acquire web resources carried by the web view page from a resource service and return the web resources; receiving the web resources returned by the proxy service for the resource acquisition request; and rendering the web view page based on the web resources through the page processing service. Through the application, the safety of the web application can be ensured, and the rendering and running of the web view page of the subprogram in the web application can be realized.
Need to check novelty before this filing date? Find Prior Art

Claims

1. A method for page processing in a subroutine, characterized in that, The method includes: For the webpage view page to be rendered in the subroutine, load the page processing service. The subroutine runs in the web application, and the domain name of the page processing service is different from the domain name of the web application. The page processing service sends a resource acquisition request to the proxy service, the resource acquisition request instructing the proxy service to acquire the web page resources carried by the web page view page from the resource service and return the web page resources; The proxy service returns the webpage resource in response to the resource acquisition request; Based on the webpage resources, the webpage view page is rendered through the page processing service.

2. The method as described in claim 1, characterized in that, The page loading processing service includes: Obtain the page processing service address of the page processing service, wherein the page processing service address includes the domain name of the page processing service; Load the service resources of the page processing service address to load the page processing service.

3. The method as described in claim 2, characterized in that, The service resources for loading the page processing service address include: Create a webpage frame element whose element attribute is the page processing service address, wherein the element attribute indicates that the webpage frame element is used to carry the service resources of the page processing service address; The service resources of the page processing service address are loaded within the webpage frame element. Rendering the webpage view page through the page processing service includes: The page processing service renders the webpage view page within the webpage frame element.

4. The method as described in claim 1, characterized in that, The web page resources include Hypertext Markup Language resources; the rendering of the web page view page based on the web page resources through the page processing service includes: The hypertext markup language resource is parsed to obtain the resource parsing result; If a script tag is detected during the parsing process, the script resources of the webpage view page are obtained; Based on the resource parsing results and the script resources, construct the page tree structure of the webpage view page; Based on the page tree structure, the webpage view page is rendered through the page processing service.

5. The method as described in claim 4, characterized in that, The script resources for obtaining the webpage view page include: The page processing service sends a script retrieval request to the proxy service, the script retrieval request instructing the proxy service to retrieve the script resources of the webpage view page from the resource service and return the script resources; The proxy service receives the script resources returned in response to the script retrieval request.

6. The method as described in claim 5, characterized in that, The step of sending a script retrieval request to the proxy service through the page processing service includes: The following processing is performed through the page processing service: Intercept the initial script retrieval request initiated by the target device for the resource service, wherein the target device is the device indicated by the domain name of the page processing service; The resource service address of the resource service is added to the initial script retrieval request to obtain the script retrieval request; The proxy service sends the script retrieval request to the proxy service, and the proxy service retrieves the script resource from the resource service based on the resource service address.

7. The method as described in claim 4, characterized in that, The step of constructing the page tree structure of the webpage view based on the resource parsing results and the script resources includes: Based on the resource parsing results, construct the intermediate page tree structure of the webpage view page; Execute the script resource to obtain the script execution result; Based on the script execution result, the intermediate page tree structure is adjusted to obtain the page tree structure of the webpage view page.

8. The method as described in claim 4, characterized in that, The process of rendering the webpage view page based on the page tree structure through the page processing service includes: Determine the position and size of each page element in the page tree structure within the webpage view of the webpage view page; Based on the position and size of each page element, the page processing service draws each page element in the webpage view to render the webpage view page.

9. The method as described in claim 1, characterized in that, Before loading the page processing service for the webpage view page to be rendered for the subroutine, the method further includes: In response to a page rendering instruction for the subroutine, obtain the page tag of the page to be rendered indicated by the page rendering instruction; If the page tag includes a webpage view tag, then the page to be rendered is determined to be the webpage view page to be rendered.

10. The method as described in claim 9, characterized in that, If the page tags do not include the webpage view tags, the method further includes: The page to be rendered is determined to be the native page of the subroutine to be rendered; The method further includes: Obtain the native page resources of the native page of the subroutine from the executable file of the subroutine; The subroutine's native page is rendered based on the native page resources.

11. The method as described in claim 1, characterized in that, After the webpage view page has been rendered, the method further includes: If an interaction request is detected on the webpage view page, the interaction request is sent to the proxy service through the page processing service. The interaction request indicates that the proxy service obtains the response content for the interaction request from the resource service and returns the response content. The response content returned by the proxy service in response to the interaction request is received.

12. The method as described in claim 1, characterized in that, If an interaction request from the target page of the subroutine is detected, the method further includes: If the interaction request is a native request of a subroutine, the interaction request is sent to the target service requested by the interaction request, and the interaction request indicates that the target service returns the response content for the interaction request; If the interaction request is a webpage view page request, the interaction request is sent to the proxy service. The interaction request indicates that the proxy service obtains the response content for the interaction request from the target service and returns the response content.

13. The method as described in claim 12, characterized in that, The method further includes: Determine whether the service domain name of the target service is in the service domain name whitelist of the subroutine; If the service domain name is in the service domain name whitelist, the interaction request is determined to be a native request of the subroutine; If the service domain name is not in the service domain name whitelist, the interaction request is determined to be a webpage view page request.

14. The method according to any one of claims 1-13, characterized in that, The resource acquisition request includes the resource service address of the resource service; The proxy service obtains the web page resource from the resource service based on the resource service address and performs security verification on the web page resource; after the security verification is successful, it returns the web page resource.

15. The method according to any one of claims 1-13, characterized in that, The method further includes: A runtime environment service is loaded in the web application. The runtime environment service is used to simulate the runtime environment of the subroutine in the browser so that the target components and target interfaces of the subroutine are adapted to the browser. The subroutine is run in the web application via the runtime environment service.

16. The method according to any one of claims 1-13, characterized in that, The page processing service and the resource service have different sources.

17. A page processing apparatus for a subroutine, characterized in that, The device includes: A loading module is used to load a page processing service for the web page view page to be rendered by the subroutine. The subroutine runs in a web application, and the domain name of the page processing service is different from the domain name of the web application. The sending module is used to send a resource acquisition request to the proxy service through the page processing service. The resource acquisition request indicates that the proxy service acquires the web page resources carried by the web page view page from the resource service and returns the web page resources. The receiving module is configured to receive the web page resource returned by the proxy service in response to the resource acquisition request; The page processing module is used to render the webpage view page based on the webpage resources through the page processing service.

18. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions for a computer; A processor, when executing computer-executable instructions stored in the memory, implements the page processing method of the subroutine according to any one of claims 1 to 16.

19. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the page processing method of the subroutine according to any one of claims 1 to 16.

20. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the page processing method of the subroutine according to any one of claims 1 to 16.