CN113760706B - Webpage debugging method and device - Google Patents

Webpage debugging method and device Download PDF

Info

Publication number
CN113760706B
CN113760706B CN202010991501.6A CN202010991501A CN113760706B CN 113760706 B CN113760706 B CN 113760706B CN 202010991501 A CN202010991501 A CN 202010991501A CN 113760706 B CN113760706 B CN 113760706B
Authority
CN
China
Prior art keywords
file
preset
webpage
debugging
script file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010991501.6A
Other languages
Chinese (zh)
Other versions
CN113760706A (en
Inventor
卢兴元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010991501.6A priority Critical patent/CN113760706B/en
Publication of CN113760706A publication Critical patent/CN113760706A/en
Application granted granted Critical
Publication of CN113760706B publication Critical patent/CN113760706B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3628Software debugging of optimised code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a webpage debugging method and device. One embodiment of the method comprises the following steps: loading a webpage in response to determining that a preset operation of a user is received; executing a first script file in the loading process of the webpage, and acquiring an identification representing whether the webpage is debugged or not; responding to the determination that the identification is a preset debugging identification, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file for representing the service codes of the webpage, comprises a preset debugging library and is only disclosed to an intranet; in the process of executing the second script file, based on a debug entry obtained by a preset debug library, a debug instruction of a user is received to debug the webpage, so that the webpage loads the second script file in a debug mode, the readability of webpage codes is improved, and the webpage debugging efficiency can be improved.

Description

Webpage debugging method and device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a webpage debugging method and device.
Background
With the development of internet technology and the popularization of mobile terminal intellectualization, more and more web pages or applications for mobile terminals are developed and used. However, the process often occurs in the whole development and test process until the production process, and the normal web page in the development and test process is actually on line, so that the production environment is abnormal. There are many reasons for this, such as various problems caused by different operating system platforms, operating system versions, mobile phone manufacturers, web browser kernels, application programs, and server returned data, and it is necessary to quickly debug and locate the problem web pages.
Disclosure of Invention
The embodiment of the application provides a webpage debugging method and device.
In a first aspect, an embodiment of the present application provides a method for debugging a web page, including: loading a webpage in response to determining that a preset operation of a user is received; executing a first script file in the loading process of the webpage, and acquiring an identification representing whether the webpage is debugged or not; in response to determining that the identifier is a preset debugging identifier, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file for representing service codes of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to an intranet; and in the process of executing the second script file, receiving a debugging instruction of a user to debug the webpage based on a debugging entry obtained by a preset debugging library.
In some embodiments, the above method further comprises: and executing a third script file in response to determining that the identification is a non-preset debugging identification, wherein the third script file is an encrypted and/or compressed original file representing the service code of the webpage.
In some embodiments, the first script file includes preset matching information; the responding to the determination that the identification is the preset debugging identification executes a second script file, which comprises the following steps: responding to the determination that the identification is a preset debugging identification, and acquiring information to be matched input by a user at a preset terminal for loading the webpage; and in response to determining that the information to be matched is matched with the preset matching information, determining that the user is the user with the authority for debugging the webpage, and executing the second script file.
In some embodiments, a preset dot matrix is arranged on a display screen of the preset terminal; the obtaining the information to be matched input by the user at the preset terminal loading the webpage includes: and acquiring information to be matched based on contact information between a user and preset points in a preset dot matrix on the display screen.
In some embodiments, the obtaining the information to be matched based on the contact information between the user and a preset point in a preset dot matrix on the display screen includes: aiming at each input operation of a user in multiple input operations on a display screen, acquiring a serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all preset points contacted in the input operation; and determining a plurality of numbers input by the user as information to be matched input by the user.
In some embodiments, the above method further comprises: and in response to determining that the information to be matched is matched with the preset matching information, modifying the preset debugging identification into a non-preset debugging identification.
In some embodiments, before loading the web page in response to determining that the user's preset operation is received, further comprising: generating a hypertext markup language file, a script language file, a web page picture file and a web page style file required for publishing a web page based on a web page code representing the web page, wherein the script language file comprises a first script file, a second script file and a third script file; for each of the plurality of files, deploying it in a corresponding service based on the file type of the file; a web page is published.
In some embodiments, for each of the plurality of files, the deploying the file in the corresponding service based on the file type of the file includes: the method comprises the steps of deploying hypertext markup language files in a webpage publishing system, deploying a first script file, a third script file and a webpage style file in a first service capable of performing domain name resolution on an intranet and an extranet, deploying a second script file in a second service capable of performing domain name resolution on the intranet, and deploying a webpage picture file in a third service capable of performing domain name resolution on the intranet and the extranet.
In a second aspect, an embodiment of the present application provides a web page debugging device, including: a loading unit configured to load a web page in response to determining that a preset operation of a user is received; the acquisition unit is configured to execute a first script file in the loading process of the webpage, and acquire an identification representing whether the webpage is debugged or not; the first execution unit is configured to execute a second script file in response to determining that the identifier is a preset debugging identifier, wherein the second script file is an unencrypted and uncompressed original file of service codes representing web pages, the second script file comprises a preset debugging library, and the second script file is only disclosed to an intranet; the debugging unit is configured to receive a debugging instruction of a user to debug the webpage based on a debugging entry obtained by a preset debugging library in the process of executing the second script file.
In some embodiments, the apparatus further comprises: and the second execution unit is configured to execute a third script file in response to determining that the identification is not the preset debugging identification, wherein the third script file is an original file which characterizes the service code of the webpage and is encrypted and/or compressed.
In some embodiments, the first script file includes preset matching information; the first execution unit is further configured to: responding to the determination that the identification is a preset debugging identification, and acquiring information to be matched input by a user at a preset terminal for loading the webpage; and in response to determining that the information to be matched is matched with the preset matching information, determining that the user is the user with the authority for debugging the webpage, and executing the second script file.
In some embodiments, a preset dot matrix is arranged on a display screen of the preset terminal; the first execution unit is further configured to: and acquiring information to be matched based on contact information between a user and preset points in a preset dot matrix on the display screen.
In some embodiments, the first execution unit is further configured to: aiming at each input operation of a user in multiple input operations on a display screen, acquiring a serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all preset points contacted in the input operation; and determining a plurality of numbers input by the user as information to be matched input by the user.
In some embodiments, the apparatus further comprises: a changing unit configured to: and in response to determining that the information to be matched is matched with the preset matching information, modifying the preset debugging identification into a non-preset debugging identification.
In some embodiments, the apparatus further comprises: a generation unit configured to generate a hypertext markup language file, a scripting language file, a web page picture file, and a web page style file required for publishing a web page based on a web page code representing the web page, wherein the scripting language file includes a first scripting file, a second scripting file, and a third scripting file; a deployment unit configured to deploy, for each of a plurality of files, the file in a corresponding service based on a file type of the file; and the publishing unit is configured to publish the webpage.
In some embodiments, the deployment unit is further configured to: the method comprises the steps of deploying hypertext markup language files in a webpage publishing system, deploying a first script file, a third script file and a webpage style file in a first service capable of performing domain name resolution on an intranet and an extranet, deploying a second script file in a second service capable of performing domain name resolution on the intranet, and deploying a webpage picture file in a third service capable of performing domain name resolution on the intranet and the extranet.
In a third aspect, embodiments of the present application provide a computer readable medium having a computer program stored thereon, wherein the program when executed by a processor implements a method as described in any of the implementations of the first aspect.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
According to the webpage debugging method and device, the webpage is loaded by responding to the fact that the preset operation of the user is received; executing a first script file in the loading process of the webpage, and acquiring an identification representing whether the webpage is debugged or not; in response to determining that the identifier is a preset debugging identifier, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file for representing service codes of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to an intranet; in the process of displaying and executing the second script file, based on a debug entry obtained by a preset debug library, a debug instruction of a user is received to debug the webpage, so that the webpage loads the uncompressed and unencrypted second script file in a debug mode, the readability of webpage codes is improved, and the webpage debug efficiency can be improved; in each webpage code release and deployment stage, a debugging library of the debugging code is deployed in a second script file, and when an online problem is encountered, a second reissue webpage of the second script file does not need to be revised again; the second script file is only disclosed for the intranet, so that the webpage security is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a method of debugging a web page in accordance with the present application;
FIG. 3 is a schematic diagram of a preset lattice of a web page debugging method according to the present application;
FIG. 4 is a schematic diagram of a preset dot matrix representation number according to the method for debugging a web page of the present application;
Fig. 5 is a schematic diagram of an application scenario of the web page debugging method according to the present embodiment;
FIG. 6 is a flow chart of yet another embodiment of a method of debugging a web page in accordance with the present application;
FIG. 7 is a logic flow diagram for modification of an identification in accordance with the present application;
FIG. 8 is a block diagram of one embodiment of a web page debugging device in accordance with the present application;
FIG. 9 is a schematic diagram of a computer system suitable for use in implementing embodiments of the present application.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the present application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
FIG. 1 illustrates an exemplary architecture 100 in which the web page debugging method and apparatus of the present application may be applied.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 101, 102, 103 may be hardware devices or software supporting network connections for data interaction and data processing. When the terminal device 101, 102, 103 is hardware, it may be various electronic devices supporting network connection, information interaction, display, processing, etc., including, but not limited to, smartphones, tablet computers, electronic book readers, laptop and desktop computers, etc. When the terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices. It may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
The server 105 may be a server providing various services, such as a background processing server for debugging a web page loaded by the terminal devices 101, 102, 103. In the loading process of the webpage, the background processing server executes the first script file to acquire an identification representing whether the webpage is debugged or not; and responding to the determination that the identification is the preset debugging identification, executing the second script file, and receiving a debugging instruction of a user to debug the webpage based on a debugging entry obtained by a preset debugging library in the process of displaying and executing the second script file on the terminal equipment. As an example, the server 105 may be a cloud server.
The server may be hardware or software. When the server is hardware, the server may be implemented as a distributed server cluster formed by a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (e.g., software or software modules for providing distributed services), or as a single software or software module. The present invention is not particularly limited herein.
It should also be noted that, the method for debugging a web page provided by the embodiment of the present disclosure may be executed by a server, may be executed by a terminal device, or may be executed by the server and the terminal device in cooperation with each other. Accordingly, each part (for example, each unit, sub-unit, module, sub-module) included in the web page debugging device may be all disposed in the server, may be all disposed in the terminal device, or may be disposed in the server and the terminal device respectively.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. When the electronic device on which the web page debugging method is running does not need to perform data transmission with other electronic devices, the system architecture may include only the electronic device (e.g., a server or a terminal device) on which the web page debugging method is running.
With continued reference to FIG. 2, a flow 200 of one embodiment of a web page debugging method is shown, comprising the steps of:
In step 201, in response to determining that a preset operation of the user is received, a web page is loaded.
In this embodiment, the execution body of the web page debugging method (for example, the terminal device or the server in fig. 1) may load the web page in response to determining that the preset operation of the user is received.
The web page may be a web page carrying business content of various website applications. By way of example, the web page may be a web page in a shopping class application that presents related merchandise.
The web page in this embodiment generally includes the following files: hypertext markup language files, scripting language files, web style files, and web picture files. The hypertext markup language file comprises a series of labels, and document formats on a network can be unified through the labels, so that scattered network resources are connected into a logic whole. A hypertext markup language file is a descriptive text composed of hypertext markup language commands that can specify words, graphics, animations, sounds, forms, links, etc.
The scripting language files are typically Javascript files, including a first script file, a second script file, and a third script file. Wherein the first script file is used for guiding the hypertext markup language file to load a second script file or a third script file of service codes representing web pages. Although the second script file and the third script file both represent service codes of the webpage, the second script file is an original file which is not encrypted and compressed and is only disclosed to the intranet; the third script file is an encrypted and/or compressed file, and can be disclosed to the internal network and the external network.
The intranet is a local area network or a private office network where a user is located, and is only accessed by a device terminal in the local area network or the private office network; the external network is a public network, and all equipment terminals accessing the Internet of things can be accessed.
The web page style file is a file representing a presentation style of a web page, and the web page picture file includes pictures involved in the web page.
Step 202, executing a first script file in the loading process of the webpage, and obtaining an identification representing whether the webpage is debugged.
In this embodiment, the executing body executes the first script file in the loading process of the web page, and obtains the identifier that characterizes whether the web page is debugged.
The method comprises the steps of executing a first script file to guide a hypertext markup language file to load a second script file or a third script file representing business codes of a webpage, and loading an identifier representing whether the webpage is debugged according to the identifier of the second script file or the third script file.
As an example, the executing body may obtain, from a local storage of a browser that loads the web page, an identification that characterizes whether the web page is debugged.
In step 203, in response to determining that the identifier is a preset debug identifier, the second script file is executed.
In this embodiment, the executing body executes the second script file in response to the identification obtained in the determining step 202 being a preset debug identification.
In this embodiment, in addition to the differences between the second script file and the third script file described in step 201, the following differences exist between the two files: the second script file includes a preset debug library, and the third script file does not include a preset debug library. The preset debugging library can provide a webpage debugging tool and support related webpage debugging instructions when the second script file is executed.
The preset debug library may be a debug library that provides any web page debug tool. As an example, the preset debug library may be a debug library that provides vConsole debug tools.
In some optional implementations of this embodiment, the first script file includes preset matching information; the execution body executes the step 203 as follows:
firstly, responding to the fact that the identification is determined to be a preset debugging identification, and acquiring information to be matched input by a user at a preset terminal for loading a webpage.
Then, in response to determining that the information to be matched is matched with the preset matching information, determining that the user is the user with the authority for debugging the webpage, and executing the second script file.
In this implementation, the user having the authority to debug the web page may be, for example, a developer of the web page, and a technician having specialized web page debugging skills. Because the above-mentioned identification is a preset debug identification, that is, the uncompressed and unencrypted original file of the web page is executed in the debug mode of the web page, in order to ensure the security of the web page code, the user's authority needs to be verified, and when the user is the authority to debug the web page, the second script file can be executed.
Specifically, a preset dot matrix is arranged on a display screen of the preset terminal. The preset dot matrix may be a preset number of dot matrixes with a fixed arrangement rule. Through selecting preset points at different positions in the preset dot matrix, corresponding numbers or characters can be formed. For example, as shown in fig. 3, thirteen lattices 301 are arranged around and in the center of a display screen of a preset terminal. In the thirteen dot matrix, corresponding numbers can be formed by selecting preset points at different positions. For example, as shown in fig. 4, the thirteen lattices 401, 402, 403 represent the numbers 1, 2, 3, respectively.
The execution main body obtains information to be matched based on contact information of a user and preset points in a preset dot matrix on a display screen. The information to be matched may be a single number or character obtained based on one input operation of the user, or may be a number string or character string obtained based on multiple input operations of the user.
Specifically, the execution main body firstly obtains a serial number of each preset point contacted by a user in the input operation aiming at each input operation in multiple input operations of the user on a display screen; then, determining the number input by the input operation according to the serial numbers of all preset points contacted in the input operation; and finally, determining a plurality of digits input by the user as information to be matched input by the user.
The execution main body carries out unique marks on each preset point in the preset dot matrix, and further, the information input by a user can be rapidly identified through the serial number of each preset point contacted in one-time input operation, so that the identification efficiency of the information is improved.
In this implementation manner, the executing main body records the input times of user errors in response to determining that the information to be matched is not matched with the preset matching information; and responding to the fact that the input times of errors do not exceed the preset threshold, judging that the user is a user without the authority of debugging the webpage, executing a third script file, and responding to the fact that the input times of errors do not exceed the preset threshold, and continuously receiving information to be matched of the user.
In some optional implementations of this embodiment, in response to determining that the information to be matched matches the preset matching information, the executing entity deletes the preset debug flag.
Step 204, displaying a debug entry obtained based on a preset debug library in the process of executing the second script file, and receiving a debug instruction of the user to debug the webpage.
In this embodiment, the executing body may display a debug entry obtained based on a preset debug library during the process of executing the second script file, and receive a debug instruction of the user to debug the web page.
As an example, the third script file first executes vConsole the rendering logic of the plugin, generating an entry into the debug interface of the web page in the lower right corner of the web page interface. Furthermore, the user can enter a webpage debugging interface through the entry, and a debugging instruction is input into the webpage debugging interface to debug. Correspondingly, the execution main body receives a debugging instruction of a user to debug the webpage.
With continued reference to fig. 5, fig. 5 is a schematic diagram 500 of an application scenario of the web page debugging method according to the present embodiment. In the application scenario of fig. 5, a user 501 browses a web page in a browser through a terminal device 502. The server 503 listens to the operation information of the user 501 at the terminal device 502. In response to determining that a click operation (preset operation) of the user 501 in the web page 504 for the portal of the web page 505 is received, the web page 505 is loaded. The server 501 executes the hypertext markup language file of the web page to load the web page. In the loading process of the webpage, a first script file is executed first, and an identification representing whether the webpage is debugged or not is obtained in a local storage of a browser. Then, in response to determining that the identifier is the preset debug identifier, the server 503 executes a second script file, where the second script file is an unencrypted, uncompressed original file of service codes representing web pages, the second script file includes a preset debug library, and the second script file is only disclosed to the intranet. Finally, in the process of executing the second script file, a debug entry 506 obtained based on a preset debug library is displayed in a display interface of the terminal device 502, and a debug instruction of the user 501 is received to debug the web page.
The method provided by the embodiment of the disclosure loads the webpage by responding to the determination that the preset operation of the user is received; executing a first script file in the loading process of the webpage, and acquiring an identification representing whether the webpage is debugged or not; in response to determining that the identifier is a preset debugging identifier, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file for representing service codes of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to an intranet; in the process of displaying and executing the second script file, based on a debug entry obtained by a preset debug library, a debug instruction of a user is received to debug the webpage, so that the webpage loads the uncompressed and unencrypted second script file in a debug mode, the readability of webpage codes is improved, and the webpage debug efficiency can be improved; in each webpage code release and deployment stage, a debugging library of the debugging code is deployed in a second script file, and when an online problem is encountered, a second reissue webpage of the second script file does not need to be revised again; the second script file is only disclosed for the intranet, so that the webpage security is improved.
In some optional implementations of this embodiment, before the step 201, the executing body may further perform the following web page publishing operation:
First, based on a web page code representing a web page, a hypertext markup language file, a script language file, a web page picture file and a web page style file required for publishing the web page are generated, wherein the script language file comprises a first script file, a second script file and a third script file.
Second, for each of the plurality of files, it is deployed in the corresponding service based on the file type of the file.
The rights of the users to which each of the plurality of files is directed are different, and thus, a corresponding deployment is required for different files. Specifically, the hypertext markup language file is deployed in the web page publishing system, the first script file, the third script file and the web page style file are deployed in a first service capable of performing domain name resolution on both the intranet and the extranet, the second script file is deployed in a second service capable of performing domain name resolution on the intranet, and the web page picture file is deployed in a third service capable of performing domain name resolution on both the intranet and the extranet.
Whether the first service, the second service, or the third service, it is necessary to have a storage function and a parsing function for a file to which it is deployed.
Third, web pages are published so that they can be accessed via a URL (Uniform Resource Locator ) address.
With continued reference to FIG. 6, there is shown a schematic flow chart 600 of another embodiment of a web page debugging method in accordance with the present application, comprising the steps of:
Step 601, based on the web page code representing the web page, a hypertext markup language file, a scripting language file, a web page picture file and a web page style file required for publishing the web page are generated.
The script language file comprises a first script file, a second script file and a third script file.
Step 602, for each file in the plurality of files, deploys the file in the corresponding service based on the file type of the file.
Step 603, publishing the web page.
In step 604, in response to determining that a preset operation by the user is received, the web page is loaded.
Step 605, in the loading process of the web page, executing the first script file, and obtaining the identification representing whether the web page is debugged.
The first script file comprises preset matching information.
Step 606, in response to determining that the identifier is a preset debug identifier, obtaining information to be matched input by the user at a preset terminal loading the webpage.
In step 607, in response to determining that the information to be matched matches the preset matching information, it is determined that the user is a user having authority to debug the web page, the second script file is executed.
The second script file is an unencrypted and uncompressed original file of service codes representing the webpage, comprises a preset debugging library, and is only disclosed for an intranet.
Step 608, displaying a debug entry obtained based on a preset debug library in the process of executing the second script file, and receiving a debug instruction of the user to debug the webpage.
In step 609, in response to determining that the identification is not a preset debug identification, a third script file is executed.
The third script file is an original file which characterizes the business codes of the webpage and is encrypted and/or compressed. The non-preset debug identification may be any identification other than a preset debug identification.
As can be seen from this embodiment, compared with the embodiment corresponding to fig. 2, the process 600 of the web page debugging method in this embodiment specifically illustrates the process from web page publishing to web page debugging, wherein verification of the authority of the user is involved. Therefore, the security of webpage verification in the embodiment is further improved.
In order to improve the convenience of web page debugging, flexibility modification needs to be performed on the identification of whether the web page is debugged or not.
With continued reference to FIG. 7, there is shown an illustrative flow 700 of modification logic for controlling an identification characterizing whether a web page is debugged, comprising the steps of:
Step 701, obtaining information to be matched input by a user at a preset terminal for loading a webpage.
Step 702, determining whether the information to be matched is matched with the preset matching information.
In step 703, in response to determining that the information to be matched matches the preset matching information, an identifier that characterizes whether the web page is debugged is obtained.
In step 704, in response to determining that the identifier is a preset debug identifier, the identifier is modified to be a non-preset debug identifier.
Step 705, in response to determining that the debug flag is not preset, modifying the flag to a preset debug flag.
In step 706, in response to determining that the information to be matched is not matched with the preset matching information, the number of false inputs of the information to be matched, which is not matched, is determined.
In step 707, in response to the number of false inputs exceeding the preset threshold, acquiring information input by the user is stopped.
Step 708, in response to the number of false inputs exceeding the preset threshold, the process continues to step 701.
According to the embodiment, the user can flexibly modify the identification in the non-debugging process of the webpage, so that the webpage can be flexibly debugged according to the identification, and the convenience of webpage debugging is improved.
With continued reference to fig. 8, as an implementation of the method shown in the foregoing figures, the present disclosure provides an embodiment of a web page debugging apparatus, where the apparatus embodiment corresponds to the method embodiment shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 8, the web page debugging device includes: comprising the following steps: a loading unit 801 configured to load a web page in response to determining that a preset operation of a user is received; an obtaining unit 802, configured to execute a first script file in a loading process of a web page, and obtain an identifier that characterizes whether the web page is debugged; the first execution unit 803 is configured to execute a second script file in response to determining that the identifier is a preset debug identifier, wherein the second script file is an unencrypted and uncompressed original file of service codes representing web pages, the second script file comprises a preset debug library, and the second script file is only disclosed to an intranet; the debugging unit 804 is configured to receive a debug instruction of the user to debug the webpage based on a debug entry obtained by a preset debug library in the process of executing the second script file.
In some embodiments, the apparatus further comprises: a second execution unit (not shown in the figure) configured to execute a third script file in response to determining that the identification is a non-preset debug identification, wherein the third script file is an encrypted and/or compressed original file characterizing the service code of the web page.
In some embodiments, the first script file includes preset matching information; the first execution unit 803 is further configured to: responding to the determination that the identification is a preset debugging identification, and acquiring information to be matched input by a user at a preset terminal for loading the webpage; and in response to determining that the information to be matched is matched with the preset matching information, determining that the user is the user with the authority for debugging the webpage, and executing the second script file.
In some embodiments, a preset dot matrix is arranged on a display screen of the preset terminal; the first execution unit 803 is further configured to: and acquiring information to be matched based on contact information between a user and preset points in a preset dot matrix on the display screen.
In some embodiments, the first execution unit 803 is further configured to: aiming at each input operation of a user in multiple input operations on a display screen, acquiring a serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all preset points contacted in the input operation; and determining a plurality of numbers input by the user as information to be matched input by the user.
In some embodiments, the apparatus further comprises: a changing unit (not shown in the figure) configured to: and in response to determining that the information to be matched is matched with the preset matching information, modifying the preset debugging identification into a non-preset debugging identification.
In some embodiments, the apparatus further comprises: a generation unit (not shown in the figure) configured to generate a hypertext markup language file, a script language file, a web page picture file, and a web page style file required for publishing a web page based on a web page code representing the web page, wherein the script language file includes a first script file, a second script file, and a third script file; a deployment unit (not shown in the figure) configured to deploy, for each of the plurality of files, the file in a corresponding service based on a file type of the file; a publication unit (not shown in the figure) configured to publish the web page.
In some embodiments, the deployment unit (not shown in the figures) is further configured to: the method comprises the steps of deploying hypertext markup language files in a webpage publishing system, deploying a first script file, a third script file and a webpage style file in a first service capable of performing domain name resolution on an intranet and an extranet, deploying a second script file in a second service capable of performing domain name resolution on the intranet, and deploying a webpage picture file in a third service capable of performing domain name resolution on the intranet and the extranet.
In this embodiment, a loading unit in the webpage debugging device loads a webpage in response to determining that a preset operation of a user is received; the method comprises the steps that an acquisition unit executes a first script file in the loading process of a webpage, and an identification representing whether the webpage is debugged or not is acquired; the first execution unit responds to the fact that the identification is determined to be a preset debugging identification, and executes a second script file, wherein the second script file is an unencrypted and uncompressed original file of service codes representing web pages, comprises a preset debugging library, and is only disclosed to an intranet; in the process of executing the second script file, the debugging unit receives a debugging instruction of a user to debug the webpage based on a debugging entry obtained by a preset debugging library, so that the webpage loads the uncompressed and unencrypted second script file in a debugging mode, the readability of webpage codes is improved, and the webpage debugging efficiency can be improved; in each webpage code release and deployment stage, a debugging library of the debugging code is deployed in a second script file, and when an online problem is encountered, a second reissue webpage of the second script file does not need to be revised again; the second script file is only disclosed for the intranet, so that the webpage security is improved.
Referring now to FIG. 9, there is illustrated a schematic diagram of a computer system 900 suitable for use with devices (e.g., devices 101, 102, 103, 105 shown in FIG. 1) for implementing embodiments of the present application. The apparatus shown in fig. 9 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present application.
As shown in fig. 9, the computer system 900 includes a processor (e.g., CPU, central processing unit) 901, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM903, various programs and data necessary for the operation of the system 900 are also stored. The processor 901, the ROM902, and the RAM903 are connected to each other by a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
The following components are connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the method of the present application are performed when the computer program is executed by the processor 901.
The computer readable medium of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the client computer, partly on the client computer, as a stand-alone software package, partly on the client computer and partly on a remote computer or entirely on the remote computer or server. In the case of remote computers, the remote computer may be connected to the client computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor includes a loading unit, an acquisition unit, a first execution unit, and a debug unit. Wherein the names of the units do not constitute a limitation of the unit itself in some cases, for example, the first execution unit may also be described as "in response to determining that the identification is a preset debug identification, execute the unit of the second script file".
As another aspect, the present application also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the computer device to: loading a webpage in response to determining that a preset operation of a user is received; executing a first script file in the loading process of the webpage, and acquiring an identification representing whether the webpage is debugged or not; in response to determining that the identifier is a preset debugging identifier, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file for representing service codes of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to an intranet; and in the process of executing the second script file, receiving a debugging instruction of a user to debug the webpage based on a debugging entry obtained by a preset debugging library.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application referred to in the present application is not limited to the specific combinations of the technical features described above, but also covers other technical features formed by any combination of the technical features described above or their equivalents without departing from the inventive concept described above. Such as the above-mentioned features and the technical features disclosed in the present application (but not limited to) having similar functions are replaced with each other.

Claims (18)

1. A web page debugging method, comprising:
Loading a webpage in response to determining that a preset operation of a user is received;
executing a first script file in the loading process of the webpage, and acquiring an identification representing whether the webpage is debugged or not;
In response to determining that the identifier is a preset debugging identifier, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file representing service codes of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to an intranet;
and in the process of executing the second script file, receiving a debugging instruction of the user to debug the webpage based on a debugging entry obtained by the preset debugging library.
2. The method of claim 1, further comprising:
And executing a third script file in response to determining that the identification is a non-preset debugging identification, wherein the third script file is an original file which characterizes service codes of the webpage and is encrypted and/or compressed.
3. The method of claim 1, wherein the first script file comprises preset matching information;
the response to determining that the identifier is a preset debug identifier, executing a second script file, including:
Responding to the determination that the identification is a preset debugging identification, and acquiring information to be matched input by the user at a preset terminal loading the webpage;
and in response to determining that the information to be matched is matched with the preset matching information, determining that the user is the user with the authority of debugging the webpage, and executing the second script file.
4. The method of claim 3, wherein a preset dot matrix is arranged on a display screen of the preset terminal;
The obtaining the information to be matched input by the user at the preset terminal loading the webpage comprises the following steps:
And acquiring the information to be matched based on the contact information of the user and preset points in a preset dot matrix on the display screen.
5. The method of claim 4, wherein the obtaining the information to be matched based on contact information of the user with a preset point in a preset lattice on the display screen comprises:
aiming at each input operation of the user in multiple input operations on the display screen, acquiring a serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all preset points contacted in the input operation;
And determining a plurality of numbers input by the user as information to be matched input by the user.
6. A method according to claim 3, further comprising:
And in response to determining that the information to be matched is matched with the preset matching information, modifying the preset debugging identification into a non-preset debugging identification.
7. The method of any of claims 1-6, wherein prior to loading the web page in response to determining that the user's preset action is received, further comprising:
Generating a hypertext markup language file, a scripting language file, a web page picture file and a web page style file required for publishing the web page based on a web page code representing the web page, wherein the scripting language file comprises the first scripting file, the second scripting file and the third scripting file;
for each of the plurality of files, deploying it in a corresponding service based on the file type of the file;
And publishing the webpage.
8. The method of claim 7, wherein the deploying, for each of the plurality of files, the file in the corresponding service based on the file type of the file comprises:
The hypertext markup language file is deployed in a webpage publishing system, the first script file, the third script file and the webpage style file are deployed in a first service capable of carrying out domain name resolution on an internal network and an external network, the second script file is deployed in a second service capable of carrying out domain name resolution on the internal network, and the webpage picture file is deployed in a third service capable of carrying out domain name resolution on the internal network and the external network.
9. A web page debugging apparatus, comprising:
A loading unit configured to load a web page in response to determining that a preset operation of a user is received;
the acquisition unit is configured to execute a first script file in the loading process of the webpage, and acquire an identification representing whether the webpage is debugged or not;
the first execution unit is configured to execute a second script file in response to determining that the identifier is a preset debugging identifier, wherein the second script file is an unencrypted and uncompressed original file representing service codes of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to an intranet;
And the debugging unit is configured to receive a debugging instruction of the user to debug the webpage based on a debugging entry obtained by the preset debugging library in the process of executing the second script file.
10. The apparatus of claim 9, further comprising:
And the second execution unit is configured to execute a third script file in response to determining that the identification is a non-preset debugging identification, wherein the third script file is an encrypted and/or compressed original file representing the service code of the webpage.
11. The apparatus of claim 9, wherein the first script file includes preset matching information therein;
The first execution unit is further configured to:
responding to the determination that the identification is a preset debugging identification, and acquiring information to be matched input by the user at a preset terminal loading the webpage; and in response to determining that the information to be matched is matched with the preset matching information, determining that the user is the user with the authority of debugging the webpage, and executing the second script file.
12. The device of claim 11, wherein a preset dot matrix is arranged on a display screen of the preset terminal;
The first execution unit is further configured to:
And acquiring the information to be matched based on the contact information of the user and preset points in a preset dot matrix on the display screen.
13. The apparatus of claim 12, wherein the first execution unit is further configured to:
aiming at each input operation of the user in multiple input operations on the display screen, acquiring a serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all preset points contacted in the input operation; and determining a plurality of numbers input by the user as information to be matched input by the user.
14. The apparatus of claim 11, further comprising:
A changing unit configured to:
And in response to determining that the information to be matched is matched with the preset matching information, modifying the preset debugging identification into a non-preset debugging identification.
15. The apparatus of any of claims 9-14, further comprising:
A generation unit configured to generate, based on a web page code representing the web page, a hypertext markup language file, a scripting language file, a web page picture file, and a web page style file required for publishing the web page, wherein the scripting language file includes the first scripting file, the second scripting file, and the third scripting file;
A deployment unit configured to deploy, for each of a plurality of files, the file in a corresponding service based on a file type of the file;
and the publishing unit is configured to publish the webpage.
16. The apparatus of claim 15, wherein the deployment unit is further configured to:
The hypertext markup language file is deployed in a webpage publishing system, the first script file, the third script file and the webpage style file are deployed in a first service capable of carrying out domain name resolution on an internal network and an external network, the second script file is deployed in a second service capable of carrying out domain name resolution on the internal network, and the webpage picture file is deployed in a third service capable of carrying out domain name resolution on the internal network and the external network.
17. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-8.
18. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-8.
CN202010991501.6A 2020-09-17 2020-09-17 Webpage debugging method and device Active CN113760706B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010991501.6A CN113760706B (en) 2020-09-17 2020-09-17 Webpage debugging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010991501.6A CN113760706B (en) 2020-09-17 2020-09-17 Webpage debugging method and device

Publications (2)

Publication Number Publication Date
CN113760706A CN113760706A (en) 2021-12-07
CN113760706B true CN113760706B (en) 2024-05-17

Family

ID=78785737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010991501.6A Active CN113760706B (en) 2020-09-17 2020-09-17 Webpage debugging method and device

Country Status (1)

Country Link
CN (1) CN113760706B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713321A (en) * 2016-12-26 2017-05-24 中国银联股份有限公司 Authority management method and device for debugging function of point of sale
CN107729232A (en) * 2017-09-27 2018-02-23 深圳市赛亿科技开发有限公司 A kind of script debugging method and device based on JS
US9959192B1 (en) * 2015-09-15 2018-05-01 Google Llc Debugging interface for inserted elements in a resource
CN108063959A (en) * 2016-11-09 2018-05-22 北京国双科技有限公司 Adjustment method, client, server and the system of set-top box
WO2018108041A1 (en) * 2016-12-13 2018-06-21 腾讯科技(深圳)有限公司 Remote debugging method and device, and computer storage medium
CN109408310A (en) * 2018-10-19 2019-03-01 网易(杭州)网络有限公司 Adjustment method, server and the readable storage medium storing program for executing of server
CN110795344A (en) * 2019-10-14 2020-02-14 深圳晶泰科技有限公司 Distributed high-performance computing cluster-oriented debugging system
CN111078554A (en) * 2019-12-16 2020-04-28 腾讯科技(深圳)有限公司 Applet debugging method, device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10268536B2 (en) * 2016-11-30 2019-04-23 Oracle International Corporation Secure debugging with an encrypted token

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9959192B1 (en) * 2015-09-15 2018-05-01 Google Llc Debugging interface for inserted elements in a resource
CN108063959A (en) * 2016-11-09 2018-05-22 北京国双科技有限公司 Adjustment method, client, server and the system of set-top box
WO2018108041A1 (en) * 2016-12-13 2018-06-21 腾讯科技(深圳)有限公司 Remote debugging method and device, and computer storage medium
CN106713321A (en) * 2016-12-26 2017-05-24 中国银联股份有限公司 Authority management method and device for debugging function of point of sale
CN107729232A (en) * 2017-09-27 2018-02-23 深圳市赛亿科技开发有限公司 A kind of script debugging method and device based on JS
CN109408310A (en) * 2018-10-19 2019-03-01 网易(杭州)网络有限公司 Adjustment method, server and the readable storage medium storing program for executing of server
CN110795344A (en) * 2019-10-14 2020-02-14 深圳晶泰科技有限公司 Distributed high-performance computing cluster-oriented debugging system
CN111078554A (en) * 2019-12-16 2020-04-28 腾讯科技(深圳)有限公司 Applet debugging method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Web网络应用程序开发的安全策略研究;温铂;马占卿;;内蒙古医学院学报;20071215(S1);全文 *

Also Published As

Publication number Publication date
CN113760706A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
CN110708346B (en) Information processing system and method
US8621613B1 (en) Detecting malware in content items
CN109359194B (en) Method and apparatus for predicting information categories
CN110554876A (en) Method and device for compiling android project
CN106874519B (en) Page display method and device
CN110362488B (en) Page testing method and device, electronic equipment and storage medium
CN109582317B (en) Method and apparatus for debugging hosted applications
CN110795649A (en) Target page display method, device and system and electronic equipment
CN110928571A (en) Business program development method and device
CN113760729A (en) Code detection method and device
US10129278B2 (en) Detecting malware in content items
CN112631590A (en) Component library generation method and device, electronic equipment and computer readable medium
CN112559024A (en) Method and device for generating transaction code change list
CN110874446A (en) Page display method and system, computer system and computer readable medium
CN113760706B (en) Webpage debugging method and device
CN111338928A (en) Chrome-based browser testing method and device
CN111783006B (en) Page generation method and device, electronic equipment and computer readable medium
CN113535565A (en) Interface use case generation method, device, equipment, medium and program product
CN113377376A (en) Data packet generation method, data packet generation device, electronic device, and storage medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN110196803B (en) Software defect training method and system
CN112068814A (en) Method, device, system and medium for generating executable file
CN113360417B (en) Test method, session modifier, electronic device and medium
CN116561015B (en) Map application testing method, electronic device and computer readable medium
CN113835796B (en) Method and device for processing information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant