Methods, devices and electronic equipment for blocking web page operations
By setting a transparent image as the cursor style in the web page file, the problem of needing to calculate the size of the web page area in the existing technology is solved, the effect of shielding user operations without calculating the size is achieved, and the web page display speed and shielding effect are improved.
Patent Information
- Application Number
- CN202010424661.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2015-04-03
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2035-04-03
AI Technical Summary
The existing technology needs to calculate the size of the web page area to be blocked before blocking user operations, resulting in reduced page display speed and poor actual blocking effect.
By setting the cursor style of the area to be blocked in the web page file to a transparent image of a preset size, and displaying the transparent image when the mouse cursor moves to the area to be blocked, user operations can be blocked without calculating the size.
It improves web page display speed and shielding effect, and reduces the possibility of users operating in shielded areas.
Smart Images

Figure CN111813468B
Abstract
Description
[0001] This application is a divisional application of a Chinese patent application filed on April 3, 2015, with application number 201510158339.9 and invention name “Method, device and electronic device for shielding web page operations”. Technical Field
[0002] The present application relates to the field of Internet technology, and more particularly to a method and device for shielding web page operations. The present application also relates to electronic equipment. Background Art
[0003] With the continuous development of Internet technology, Internet-based applications are also increasing, such as online finance, online shopping, social media, e-commerce, instant messaging, etc. Various applications provide users with rich and colorful services. With the increasing number of Internet applications, the information on web pages is becoming more and more abundant, and more and more web page information needs to be protected. At the same time, with the enrichment of website functions, there are also various problems caused by user misoperation, such as changing source data through web page operations. Therefore, many pages need to restrict users from clicking and dragging the mouse on specific areas to be blocked, and only retain the read-only browsing function for users.
[0004] At present, a common method to solve the above needs is to cover the web page element position corresponding to the area to be shielded with a web page element of the same size as the area to be shielded and transparent. The role of this web page element is equivalent to a mask layer, which is used to cover the area to be shielded. By setting this mask layer, users cannot operate the web page content under the mask layer, thereby achieving the effect of shielding users from clicking, dragging, and other operations on the area to be shielded. However, this method has the following disadvantages:
[0005] 1) When shielding the user operation of the shielded area, the size of the shielded area must be calculated first, and then a transparent web page element with the same size as the shielded area can be covered on the shielded area. It can be seen that the step of calculating the size of the shielded area will reduce the page display speed.
[0006] 2) The size of the area to be shielded can be calculated only after the area to be shielded is loaded. Therefore, before the user's operation on the area to be shielded is actually shielded and takes effect, the user can still operate the area to be shielded.
[0007] 3) Users who are familiar with browsers can hide or remove the mask layer through the browser's own tools, thereby removing the user operation shielding process for the shielded area, and the actual shielding effect is poor.
[0008] In summary, the prior art has the problem that the size of the to-be-shielded webpage area must be calculated first before the user can be shielded from operating the to-be-shielded area in the webpage. Summary of the invention
[0009] The present application provides a method and device for shielding web page operations to solve the problem in the prior art that the size of the web page area to be shielded must be calculated first before shielding the user from operating the area to be shielded in the web page. The present application also provides an electronic device.
[0010] The present application provides a method for shielding web page operations, comprising:
[0011] The cursor style corresponding to the area to be shielded in the webpage file is set to a transparent image of a preset size;
[0012] The web page file is stored.
[0013] Optionally, the webpage file includes a parent webpage element of the area to be shielded; and the cursor style corresponding to the area to be shielded in the webpage file is set to a transparent image of a preset size in the following manner:
[0014] The cursor style corresponding to the parent web page element is set to the transparent image.
[0015] Optionally, before setting the cursor style corresponding to the parent webpage element to the transparent image, the method further includes:
[0016] Obtain the parent webpage element of the area to be shielded.
[0017] Optionally, the cursor style corresponding to the area to be shielded in the webpage file is set to a transparent image of a preset size in the following manner:
[0018] The cursor styles corresponding to the web page elements included in the area to be shielded are respectively set as the transparent pictures.
[0019] Optionally, before setting the cursor styles corresponding to the respective web page elements included in the to-be-shielded area as the transparent image, the method further includes:
[0020] Obtain each web page element included in the area to be shielded.
[0021] Optionally, the web page element is an operable web page element.
[0022] Optionally, the cursor style corresponding to the area to be shielded in the webpage file is set to a transparent image of a preset size in the following manner:
[0023] Through the mouse cursor attribute of the cascading style, the cursor style corresponding to the area to be shielded in the web page file is set to a transparent image of a preset size.
[0024] Accordingly, the present application also provides a device for shielding web page operations, including:
[0025] A setting unit, used to set the cursor style corresponding to the area to be shielded in the webpage file to a transparent picture of a preset size;
[0026] The storage unit is used to store the web page file.
[0027] Optionally, also include:
[0028] The first acquisition unit is used to acquire each web page element included in the area to be shielded.
[0029] Optionally, also include:
[0030] The second acquisition unit is used to acquire the parent webpage element of the area to be shielded.
[0031] In addition, the present application also provides an electronic device, the electronic device comprising:
[0032] monitor;
[0033] Processor; and
[0034] A memory, wherein the memory is configured to store a web page file including an area to be shielded, wherein the cursor style corresponding to the area to be shielded is set to a transparent image of a preset size; when the web page file is opened by a browser, the web page file is displayed on the display, and when the mouse cursor moves to the area to be shielded, the mouse cursor is invisible.
[0035] The present application also provides another method for shielding web page operations, including:
[0036] Listen for scheduled mouse events;
[0037] When the predetermined mouse event indicates that the mouse cursor is located in the area to be shielded, a web page element of a preset size is transparently displayed above the area to be shielded at the current position of the mouse cursor.
[0038] Optionally, the predetermined mouse event is a mouse movement event;
[0039] When the mouse movement event is monitored, before transparently displaying a web page element of a preset size above the to-be-shielded area at the current position of the mouse cursor, the method further includes:
[0040] Get the current position of the mouse cursor;
[0041] Determine whether the current position of the mouse cursor is within the area to be shielded;
[0042] If the above judgment result is yes, it is determined that the mouse cursor is located in the area to be shielded.
[0043] Optionally, the determining whether the current position of the mouse cursor is within the area to be shielded includes:
[0044] Obtaining the current position of the area to be shielded in the visible area of the browser;
[0045] It is determined whether the current position of the mouse cursor is located at the current position of the area to be shielded in the visible area of the browser.
[0046] Optionally, the predetermined mouse event is an event in which a mouse cursor moves onto the area to be shielded.
[0047] Optionally, the web page element includes a picture element.
[0048] Optionally, the web page element is pre-included in the web page file.
[0049] Accordingly, the present application also provides another device for shielding web page operations, including:
[0050] A monitoring unit, used to monitor predetermined mouse events;
[0051] The display unit is used for transparently displaying a web page element of a preset size above the to-be-shielded area at the current position of the mouse cursor when the predetermined mouse event indicates that the mouse cursor is located in the to-be-shielded area.
[0052] Optionally, the predetermined mouse event is a mouse movement event; and the device further comprises:
[0053] A judging unit is used to judge whether the mouse cursor is located in the area to be shielded.
[0054] Optionally, the judging unit includes:
[0055] An acquisition subunit, used for acquiring the current position of the mouse cursor;
[0056] A judging subunit, used for judging whether the current position of the mouse cursor is within the area to be shielded;
[0057] The determination subunit is used to determine that the mouse cursor is located in the area to be shielded if the above determination result is yes.
[0058] Optionally, the judging subunit includes:
[0059] A first acquisition subunit is used to acquire the current position of the area to be shielded in the visible area of the browser;
[0060] The first judging subunit is used to judge whether the current position of the mouse cursor is located at the current position of the area to be shielded in the visible area of the browser.
[0061] In addition, the present application also provides another electronic device, characterized in that the electronic device includes:
[0062] monitor;
[0063] Processor; and
[0064] A memory, wherein the memory is configured to store a web page file including an area to be shielded; when the web page file is opened by a browser, a predetermined mouse event is monitored; when the predetermined mouse event is monitored, if the mouse cursor is located in the area to be shielded, a web page element of a preset size is transparently displayed above the area to be shielded at the current position of the mouse cursor.
[0065] The present application also provides another method for shielding web page operations, including:
[0066] Get the display content of the area to be shielded;
[0067] Generate pictorial display content according to the display content of the area to be shielded;
[0068] The display content of the to-be-shielded area is replaced with the pictorial display content.
[0069] Optionally, when loading a page, include:
[0070] Start monitoring page scroll events;
[0071] When the page scrolling event is monitored, determining whether the area to be shielded is within the visible area of the browser;
[0072] If the above judgment result is yes, then the method of shielding the web page operation is executed.
[0073] Optionally, when loading a web page file, the method of shielding the web page operation is executed.
[0074] Optionally, replacing the display content of the to-be-shielded area with the pictorial display content includes:
[0075] Deleting the displayed content of the area to be shielded;
[0076] The pictorial display content is inserted into the original position of the area to be shielded in the web page file.
[0077] Optionally, before inserting the pictorial display content into the original position of the to-be-shielded area in the webpage file, the method further includes:
[0078] The original position of the area to be shielded in the web page file is obtained.
[0079] Optionally, after generating the graphical display content, the method further includes:
[0080] The imaged display content is stored.
[0081] Accordingly, the present application also provides another device for shielding web page operations, including:
[0082] An acquisition unit, used for acquiring display content of the area to be shielded;
[0083] A generating unit, configured to generate pictorial display content according to the display content of the area to be shielded;
[0084] A replacement unit is used to replace the display content of the to-be-shielded area with the pictorial display content.
[0085] Optionally, also include:
[0086] The monitoring unit is used to start monitoring page scrolling events;
[0087] A judging unit, configured to judge whether the area to be shielded is within the visible area of the browser when the page scrolling event is monitored;
[0088] The determination unit is used to execute the method of shielding the webpage operation if the above determination result is yes.
[0089] Optionally, the replacement unit includes:
[0090] A deleting subunit, used to delete the displayed content of the area to be shielded;
[0091] The inserting subunit is used to insert the pictorial display content into the original position of the area to be shielded in the web page file.
[0092] Optionally, the replacement unit further includes:
[0093] The acquisition subunit is used to acquire the original position of the area to be shielded in the web page file.
[0094] Optionally, also include:
[0095] A storage unit is used to store the pictorial display content.
[0096] In addition, the present application also provides another electronic device, the electronic device comprising:
[0097] monitor;
[0098] Processor; and
[0099] A memory, wherein the memory is configured to store a web page file including an area to be shielded; when the web page file is opened by a browser, obtain the display content of the area to be shielded; generate pictorial display content based on the display content of the area to be shielded; and replace the display content of the area to be shielded with the pictorial display content.
[0100] Compared with the prior art, this application has the following advantages:
[0101] The method, device and electronic device for shielding web page operations provided in the present application generate pictorial display content according to the display content of the area to be shielded, and replace the display content of the area to be shielded with the pictorial display content. This makes it possible to shield the mouse operation of the area to be shielded in the web page without calculating the size of the area to be shielded, thereby achieving the effect of improving the web page display speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0102] Figure 1 is a flow chart of an embodiment of a method for shielding web page operations of the present application;
[0103] Figure 2 is a schematic diagram of an embodiment of a device for shielding web page operations of the present application;
[0104] Figure 3 is another flow chart of an embodiment of the method for shielding web page operation of the present application;
[0105] Figure 4 is another schematic diagram of an embodiment of the device for shielding web page operations of the present application;
[0106] Figure 5 is another flow chart of an embodiment of the method for shielding web page operations of the present application;
[0107] Figure 6 This is another schematic diagram of an embodiment of the device for shielding web page operations of the present application. DETAILED DESCRIPTION
[0108] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0109] In the present application, a method, device and electronic device for shielding web page operations are provided, which are described in detail one by one in the following embodiments.
[0110] The embodiment of the present application provides a method for shielding web page operations, and the design concept is: when the mouse cursor moves to the area to be shielded, the mouse cursor in the area to be shielded is hidden. Since the cursor is invisible in the area to be shielded, it can reduce most of the possibilities of users operating the area to be shielded.
[0111] Please refer to Figure 1 , which is a flow chart of an embodiment of a method for shielding web page operations of the present application. The method comprises the following steps:
[0112] Step S101: setting the cursor style corresponding to the area to be shielded in the web page file to a transparent image of a preset size.
[0113] The area to be shielded described in the embodiment of the present application is located in a web page, and the area to be shielded includes at least one web page element. According to the nature of the user's operation on the web page elements, the web page elements included in the area to be shielded are divided into inoperable web page elements and operable web page elements, for example: images and labels are inoperable web page elements, and text boxes, drop-down boxes, option buttons, and submit buttons are operable web page elements. In essence, the method provided in the embodiment of the present application really needs to shield the object operated by the user from being an operable web page element.
[0114] The transparent image described in the embodiment of the present application is essentially a blank image, which is used as the cursor style corresponding to the area to be shielded, and is displayed transparently above the area to be shielded, so that the mouse cursor is invisible in the area to be shielded, thereby achieving the effect of hiding the mouse cursor and reducing the possibility of most operations.
[0115] To implement the method provided in the embodiment of the present application, two different methods can be used to implement step S101, and the cursor style corresponding to the area to be shielded in the web page file is set to a transparent image of a preset size. The two methods are specifically: 1) setting the cursor style corresponding to each web page element included in the area to be shielded to a transparent image of a preset size one by one; 2) setting the cursor style corresponding to the parent web page element of the area to be shielded to a transparent image of a preset size. The above two methods are only changes in specific implementation methods, and do not deviate from the core of this application, and therefore are within the scope of protection of this application. The above two specific implementation methods are described below respectively.
[0116] Method 1: Set the cursor style corresponding to each web page element included in the area to be blocked to a transparent image of preset size one by one
[0117] In order to implement the method provided by the embodiment of the present application in the first mode, it is necessary to first obtain each web page element included in the area to be shielded. After obtaining each web page element, the cursor style corresponding to the web page element is set to a transparent image of a preset size one by one. Since the objects in the web page that really need to be shielded from user operations are operable web page elements, in order to reduce the amount of coding for developers, in this embodiment, only the cursor styles corresponding to each operable web page element included in the area to be shielded are set to transparent images of a preset size.
[0118] CSS (Cascading Style Sheets) technology provides the function of customizing the cursor style for web page elements. Specifically, the type (shape) of the cursor to be displayed is specified through the cursor attribute, which defines the cursor shape used when the mouse pointer is placed within the boundaries of an element. The cursor attribute in CSS can accept many types of cursor style attributes, as shown in Table 1:
[0119] Mouse cursor property value describe hand hand crosshair Cross text Text selection symbols wait Hourglass shape of Windows default Default mouse shape help Mouse with question mark e-resize Arrow pointing east ne-resize Arrow pointing northeast n-resize North pointing arrow nw-resize Arrow pointing northwest w-resize Arrow pointing west sw-resize Arrow pointing southwest s-resize Arrow pointing south se-resize Arrow pointing southeast
[0120] Table 1. Cursor attribute value table
[0121] Table 1 lists various commonly used cursor styles, which are applied to various specific demand scenarios. In addition to the cursor style attribute values listed in Table 1, the cursor attribute also provides a url() expression for customizing the cursor pattern style based on a specified specific image.
[0122] In this embodiment, the url() expression in the cursor attribute provided by CSS technology is used to set the cursor style corresponding to each web page element included in the area to be shielded to a transparent image of a preset size. An example statement of the CSS code for a custom cursor style is: custom_cursor{cursor:url('some-cursor.ico'),default;}, where some-cursor.ico is a specified specific image. In this embodiment, the specified specific image is a transparent image of a preset size. For example: if the web page element is a text box, then the code <textarea class="custom_cursor"> Text content< / textarea> ,or <textarea style="cursor:url('some-cursor.ico')"> Text content< / textarea> , set the cursor style corresponding to the web page element to a custom cursor style.
[0123] Since the cursor styles corresponding to each web page element included in the area to be shielded are set to transparent images of preset sizes, when the mouse moves into the area of each web page element, the mouse cursor will be displayed as a transparent image of preset sizes instead of the default mouse cursor style, so that the mouse cursor is invisible within the range of each web page element included in the area to be shielded, thereby achieving the effect of reducing the possibility of users performing most operations on the area to be shielded.
[0124] In practical applications, the size of the transparent image can be customized. It should be noted that, in order to prevent the transparent image from covering the area outside the area to be shielded, preferably, the size of the transparent image is set to 1 pixel to accurately represent the current mouse position. The reason for setting the size of the transparent image to 1 pixel is that when the mouse moves to the boundary of the area to be shielded, if the size of the transparent image is too large, the transparent image will cover the area outside the area to be shielded.
[0125] Method 2: Set the cursor style corresponding to the parent web page element of the area to be blocked to a transparent image of a preset size.
[0126] In the first method, the web page developer needs to set the cursor style corresponding to each web page element included in the area to be shielded to a transparent image of a preset size one by one. It can be seen that the first method to implement step S101 has a large workload for the web page developer. Furthermore, a large amount of manual coding will increase the possibility of errors in the web page.
[0127] In order to reduce manual workload, in practical applications, it is preferred to set the cursor style corresponding to the parent web page element of the area to be shielded to a transparent image of a preset size. To this end, it is first necessary to obtain the parent web page element of the area to be shielded. The parent web page element described in the embodiment of the present application can be a paragraph, a table, or other web page element that can include the area to be shielded. In this embodiment, the parent web page element of the area to be shielded can be obtained through a JavaScript selector.
[0128] After obtaining the parent web page element of the area to be shielded, it is only necessary to set the cursor style corresponding to the parent web page element to the transparent image, so as to set the cursor style corresponding to the entire area to be shielded to a transparent image of a preset size. CSS has a style inheritance feature, that is, child web page elements can automatically inherit the style attributes of the parent web page element to which they belong. After setting the cursor style corresponding to the parent web page element of the area to be shielded, the cursor style corresponding to each web page element included in the area to be shielded will be automatically set to the cursor style of the parent web page element of the area to be shielded, thereby achieving the effect of hiding the mouse cursor in the area to be shielded. Compared with method one, adopting method two to implement the method provided in the embodiment of the present application can achieve the effect of minimizing the amount of manual coding.
[0129] Step S103: storing the web page file.
[0130] After the web developer sets the cursor style corresponding to the area to be shielded in the web page file to a transparent image of a preset size through step S101, step S103 can be executed to save the settings of the mouse cursor style. When the client browser opens the web page file, the CSS rule for hiding the mouse cursor is parsed and takes effect. When the user moves the mouse cursor to the area to be shielded, the mouse cursor style becomes a transparent blank image displayed above the area to be shielded, that is, the mouse cursor is invisible in the area to be shielded, thereby achieving the effect of hiding the mouse cursor and reducing the possibility of most operations.
[0131] In the above embodiment, a method for shielding web page operations is provided, and correspondingly, the present application also provides a device for shielding web page operations. The device corresponds to the embodiment of the above method.
[0132] Please see Figure 2 , which is a schematic diagram of an embodiment of a device for shielding web page operations of the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described below is only illustrative.
[0133] A device for shielding webpage operations in this embodiment includes:
[0134] The setting unit 201 is used to set the cursor style corresponding to the area to be shielded in the webpage file to a transparent picture of a preset size;
[0135] The storage unit 203 is used to store the web page file.
[0136] Optionally, the device further comprises:
[0137] The first acquisition unit is used to acquire each operable web page element included in the area to be shielded.
[0138] The second acquisition unit is used to acquire the parent webpage element of the area to be shielded.
[0139] The present application also provides an electronic device, the electronic device comprising:
[0140] monitor;
[0141] Processor; and
[0142] A memory, wherein the memory is configured to store a web page file including an area to be shielded, wherein the cursor style corresponding to the area to be shielded is set to a transparent image of a preset size; when the web page file is opened by a browser, the web page file is displayed on the display, and when the mouse cursor moves to the area to be shielded, the mouse cursor is invisible.
[0143] The present application provides a method, device and electronic device for shielding web page operations. By setting the cursor style corresponding to the area to be shielded in the web page file as a transparent image of a preset size and storing the web page file, the mouse operation of the area to be shielded in the web page can be shielded without calculating the size of the area to be shielded, thereby achieving the effect of improving the web page display speed.
[0144] Corresponding to the above-mentioned method for shielding web page operations (hereinafter referred to as: the first method), the present application also provides another method for shielding web page operations (hereinafter referred to as: the second method). Figure 3 , which is another flow chart of an embodiment of a method for shielding web page operations provided by the present application. The parts of this embodiment that are the same as the first embodiment will not be repeated here. Please refer to the corresponding parts in the first embodiment.
[0145] The embodiment of the present application provides another method for shielding web page operations (i.e., the second method), the design concept of which is: through a web page element that can follow the movement of the mouse cursor, all mouse operations are applied to the web page element, thereby achieving the effect of shielding user operations. The difference between this method and the first method is that the first method hides the mouse cursor, while the second method does not hide the mouse cursor, but makes all mouse operations act on a preset web page element, which acts as a mask layer. Since all mouse operations act on the mask layer, most of the possibilities of operating the area to be shielded can be reduced.
[0146] Another method for shielding web page operations provided by an embodiment of the present application includes the following steps:
[0147] Step S301: monitoring predetermined mouse events.
[0148] The predetermined mouse event described in the embodiment of the present application can be a mouse moving event or an event in which the mouse cursor moves to the area to be shielded. The mouse moving event is triggered when the user moves the mouse cursor, while the mouse cursor moves to the area to be shielded event is triggered only when the user moves the mouse cursor to the area to be shielded.
[0149] Regarding the mouse movement event, in actual application, the JavaScript scripting language can be used to set the web page to monitor the mouse movement event, that is, the onMouseMove event, which is an event triggered when the mouse moves.
[0150] For the event of the mouse cursor moving to the area to be shielded, in actual application, the JavaScript scripting language can be used to set the web page to monitor the event of the mouse cursor moving to the area to be shielded, that is, the onMouseOver event, which is triggered when the mouse moves to the top of a certain object range (the area to be shielded in the embodiment of the present application). Correspondingly, by setting the onMouseOut event (that is, the event triggered when the mouse leaves the area of a certain object), the default mouse cursor can be restored when the mouse leaves the area to be shielded.
[0151] Using JavaScript scripting language, HTML tags that support onMouseOver events include: 、 <address> 、 <area> 、 、 <bdo>、 <big>、 <blockquote> 、、 <button>、、 <cite>、 <code>、 、 <dfn>、 、 、 、 <em>、 <fieldset> 、 <form> 、 <h1> to< / h1> <h6>、 <hr> 、 、 、 <input> 、 <kbd>、 <label>、 <legend>、 、 <map>、 、 、 <pre>、 <samp>、 <select>、、、、、、、、、< / select> <textarea>、< / textarea> 、、、、 <tt>、 、 <var>.
[0152] In actual application, the onMouseOver event can be set for the parent web page element of the area to be shielded, or the onMouseOver event can be set for each web page element included in the area to be shielded. The web page elements should be various common web page elements represented by the above-mentioned HTML tags that support the onMouseOver event.
[0153] In order to reduce manual workload, it is preferred to adopt a method of setting an onMouseOver event for the parent web page element of the area to be shielded. To set an onMouseOver event for the parent web page element of the area to be shielded, it is first necessary to obtain the parent web page element including the area to be shielded. The parent web page element described in the embodiment of the present application can be a paragraph, a table, or other web page element that can include the area to be shielded. In this embodiment, the parent web page element of the area to be shielded can be obtained through a JavaScript selector. After obtaining the parent web page element of the area to be shielded, it is only necessary to set the corresponding onMouseOver event for the parent web page element. Since the parent web page element includes the area to be shielded, the onMouseOver event of the parent web page element automatically takes effect on the area to be shielded.
[0154] Step S303: When the predetermined mouse event indicates that the mouse cursor is located in the area to be shielded, a web page element of a preset size is transparently displayed above the area to be shielded at the current position of the mouse cursor.
[0155] When the monitoring object of the method provided in the embodiment of the present application is the event of the mouse cursor moving to the area to be shielded, if the monitored event is triggered, it indicates that the mouse cursor is located in the area to be shielded. After the event is triggered, the step of transparently displaying a web page element of a preset size above the area to be shielded at the current position of the mouse cursor can be immediately executed. Thus, when the mouse is in the area to be shielded, all operations of the mouse will act on the preset web page elements, thereby reducing most of the possibilities of operating the area to be shielded.
[0156] When the monitoring object of the method provided in the embodiment of the present application is a mouse movement event, if the mouse movement event is triggered, it is first necessary to determine whether the mouse cursor is located in the area to be shielded. To this end, when the mouse movement event is monitored, before transparently displaying a web page element of a preset size above the area to be shielded at the current position of the mouse cursor, it also includes:
[0157] Step S401: Acquire the current position of the mouse cursor.
[0158] Step S403: Determine whether the current position of the mouse cursor is within the area to be shielded.
[0159] Step S405: If the above judgment result is yes, it is determined that the mouse cursor is located in the area to be shielded.
[0160] In order to determine whether the mouse cursor is located in the area to be shielded, the current position of the mouse cursor needs to be obtained first. After obtaining the current position of the mouse cursor, it can be determined whether the current position of the mouse cursor is located in the area to be shielded according to the current position of the mouse cursor and the position of the area to be shielded. If the judgment result is yes, it is determined that the mouse cursor is located in the area to be shielded.
[0161] In this embodiment, determining whether the current position of the mouse cursor is within the area to be shielded includes:
[0162] Step S4031: Obtain the current position of the area to be shielded in the visible area of the browser.
[0163] Step S4033: Determine whether the current position of the mouse cursor is located at the current position of the area to be shielded in the visible area of the browser.
[0164] The area to be shielded described in the embodiment of the present application has two position coordinate values, namely: 1) the absolute position coordinate value of the area to be shielded in the entire web page; 2) the current position coordinate value of the area to be shielded in the visible area of the browser. When judging whether the current position of the mouse cursor is within the area to be shielded, the position of the area to be shielded refers to its current position coordinate value in the visible area of the browser. Through steps S4031 and S4033, it is possible to judge whether the current position of the mouse cursor is within the area to be shielded.
[0165] When the predetermined mouse event is a mouse moving event, the specific process of the method provided by the embodiment of the present application is as follows: when the mouse moves on the web page, the mouse moving event is triggered, and the event processing program determines in real time whether the current position of the mouse cursor is located in the area to be shielded. If the judgment result is yes, a web page element of a preset size that can cover the area to be shielded and is displayed transparently is inserted at the current position of the mouse cursor. Therefore, as long as the mouse cursor moves to the area to be shielded, the mouse action can only act on the transparently displayed preset size web page element, rather than the area to be shielded itself, thereby reducing most of the possibilities of operating the area to be shielded.
[0166] In this embodiment, the web page element is a picture, and the web page element is pre-included in the web page file.
[0167] In the above embodiment, a method for shielding web page operations is provided, and correspondingly, the present application also provides a device for shielding web page operations. The device corresponds to the embodiment of the above method.
[0168] Please see Figure 4 , which is another schematic diagram of the device embodiment for shielding web page operation of the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described below is only illustrative.
[0169] A device for shielding webpage operations in this embodiment includes:
[0170] A monitoring unit 401, used for monitoring predetermined mouse events;
[0171] The display unit 403 is configured to transparently display a web page element of a preset size above the area to be shielded at the current position of the mouse cursor when the predetermined mouse event indicates that the mouse cursor is located in the area to be shielded.
[0172] Optionally, the predetermined mouse event is a mouse movement event; and the device further comprises:
[0173] The judging unit 405 is used to judge whether the mouse cursor is located in the area to be shielded.
[0174] Optionally, the judging unit 405 includes:
[0175] An acquisition subunit, used for acquiring the current position of the mouse cursor;
[0176] A judging subunit, used for judging whether the current position of the mouse cursor is within the area to be shielded;
[0177] The determination subunit is used to determine that the mouse cursor is located in the area to be shielded if the above determination result is yes.
[0178] Optionally, the judging subunit includes:
[0179] A first acquisition subunit is used to acquire the current position of the area to be shielded in the visible area of the browser;
[0180] The first judging subunit is used to judge whether the current position of the mouse cursor is located at the current position of the area to be shielded in the visible area of the browser.
[0181] The present application also provides an electronic device, the electronic device comprising:
[0182] monitor;
[0183] Processor; and
[0184] A memory, wherein the memory is configured to store a web page file including an area to be shielded; when the web page file is opened by a browser, when a mouse cursor moves over the area to be shielded, a web page element of a preset size is transparently displayed at the current position of the mouse cursor; and the web page element is overlaid above the area to be shielded.
[0185] The present application provides another method, device and electronic device for shielding web page operations. By monitoring predetermined mouse events, when the mouse cursor moves to the area to be shielded, the web page elements of a preset size are transparently displayed above the area to be shielded at the current position of the mouse cursor. The area to be shielded in the web page can be shielded from mouse operations without calculating the size of the area to be shielded, thereby achieving the effect of improving the web page display speed.
[0186] Corresponding to the above-mentioned method of shielding web page operations, the present application also provides another method of shielding web page operations (hereinafter referred to as: the third method). Figure 5 , which is another flow chart of an embodiment of a method for shielding web page operations provided by the present application. The parts of this embodiment that are the same as those of the first and second embodiments will not be repeated here. Please refer to the corresponding parts in Embodiment 1 and Embodiment 2.
[0187] The embodiment of the present application provides another method for shielding web page operations (i.e., the third method), and its design concept is: converting the area to be shielded into a corresponding image screenshot, and replacing the original area to be shielded with the image screenshot. With the third method, the content of the imaged area to be shielded cannot be seen even in the browser tool, so the effect of completely shielding user operations can be achieved, and seamless browsing can be achieved. The difference between this method and the first and second methods is that the first and second methods can only reduce most of the possibilities of operating the area to be shielded, while the third method can completely eliminate all possibilities of operating the area to be shielded.
[0188] Another method for shielding web page operations provided by an embodiment of the present application includes the following steps:
[0189] Step S501: Obtain the display content of the area to be shielded.
[0190] To generate pictorial display content according to the display content of the area to be shielded, it is first necessary to obtain the display content corresponding to the area to be shielded. The display content corresponding to the area to be shielded described in the embodiment of the present application includes the content itself and the style, wherein the style includes attributes such as font and color.
[0191] Step S503: Generate graphical display content according to the display content of the area to be shielded.
[0192] After obtaining the display content corresponding to the area to be shielded, the display content is visualized, that is, a picture file is generated, which is a webpage screenshot of the display content. In this embodiment, after generating the visualized display content, the method further includes storing the visualized display content.
[0193] Step S505: replacing the display content of the to-be-shielded area with the pictorial display content.
[0194] In actual application, the method provided by the embodiment of the present application can be implemented in two different ways, specifically: 1) When opening a web page including the area to be shielded in a browser, directly delete the original operable display content of the area to be shielded, and insert the pictorial display content into the original position of the area to be shielded in the web page file; 2) When opening a web page including the area to be shielded in a browser, if the area to be shielded is not in the visible area of the browser, no processing is performed on the area to be shielded; only when the area to be shielded is in the visible area of the browser, the processing step of replacing the display content of the area to be shielded with the pictorial display content is executed. The above two methods are only changes in specific implementation methods, and do not deviate from the core of this application, and therefore are within the protection scope of this application. The above two specific implementation methods are described below respectively.
[0195] Method 1: when a web page including the area to be shielded is opened in a browser, the original operable display content of the area to be shielded is directly deleted, and the pictorial display content is inserted into the original position of the area to be shielded in the web page file.
[0196] Since the browser has a limited visible area, only part of the web page content can be displayed in the visible area, and the web page content that exceeds the browser visible area is gradually displayed by scrolling the mouse, etc. The method provided by the present application is implemented in the first manner. Regardless of whether the area to be shielded is within the current visible area of the browser, in the source file corresponding to the web page, the display content of the area to be shielded is replaced with the image display content.
[0197] The method provided by the present application is implemented in the first manner, and before inserting the pictorial display content into the original position of the area to be shielded in the web page file, it also includes: obtaining the original position of the area to be shielded in the web page file. After obtaining the original position of the area to be shielded, the pre-generated pictorial display content can be inserted into the original position of the area to be shielded in the web page file. The original position of the area to be shielded in the web page file described in the embodiment of the present application refers to the absolute position of the area to be shielded in the web page file.
[0198] Method 2: When a web page including the area to be shielded is opened in a browser, if the area to be shielded is not in the visible area of the browser, no processing is performed on the area to be shielded; only when the area to be shielded is in the visible area of the browser, steps S501 and S503 are executed, and pictorial display content is generated according to the display content, and then step S505 is executed to replace the display content of the area to be shielded with the pictorial display content.
[0199] The method provided by the present application is implemented in the second manner. Before generating the pictorial display content according to the display content of the to-be-shielded area, when opening the webpage including the to-be-shielded area in the browser, the method further includes the following steps:
[0200] Step S601: Start monitoring page scrolling events.
[0201] In actual application, JavaScript scripting language can be used to set a monitoring page scrolling event for a web page, that is, window.onScroll event, which is an event triggered when a page scrolls. When the page is scrolled by a mouse or keyboard, the page scrolling event is triggered, and the corresponding event processing function is entered to execute step S602.
[0202] Step S602: When the page scrolling event is monitored, it is determined whether the area to be shielded is within the visible area of the browser.
[0203] Step S603: If the above judgment result is yes, then the method of shielding the web page operation is executed.
[0204] The method provided by the present application is implemented using method 2. Only when the page monitors a page scrolling event and determines that the area to be shielded is within the visible area of the browser, the method provided by the embodiment of the present application is executed, namely: step S501, step S503 and step S505. This can avoid unnecessary image replacement operations, thereby achieving the effect of improving the web page display speed.
[0205] When the method provided by the present application is implemented in the first method, when a web page is opened in a browser, the area to be shielded in the web page source file is replaced with a screenshot of the web page at the initial moment when the web page is opened, that is, the area to be shielded is imaged. Therefore, even in the browser tool, the content of the imaged area to be shielded cannot be seen. It can be seen that, compared with the second method, the first method can achieve the effect of completely shielding user operations and realize seamless browsing. However, since the first method replaces the displayed content of the area to be shielded with a picture when the web page is opened in the browser, if the first method is used to display the web page, when the area to be shielded is not in the visible area of the browser at the initial moment when the web page is opened, the display speed of the first method is obviously slower than the display speed of the second method. In practical applications, one of the above two methods is selected according to specific needs to implement the method provided by the present application.
[0206] In the above embodiment, a method for shielding web page operations is provided, and correspondingly, the present application also provides a device for shielding web page operations. The device corresponds to the embodiment of the above method.
[0207] Please see Figure 6 , which is another schematic diagram of the device embodiment for shielding web page operation of the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described below is only illustrative.
[0208] A device for shielding webpage operations in this embodiment includes:
[0209] An acquisition unit 601 is used to acquire display content of the area to be shielded;
[0210] A generating unit 603, configured to generate a graphical display content according to the display content of the area to be shielded;
[0211] The replacing unit 605 is used to replace the display content of the to-be-shielded area with the pictorial display content.
[0212] Optionally, also include:
[0213] The monitoring unit is used to start monitoring page scrolling events;
[0214] A judging unit, configured to judge whether the area to be shielded is within the visible area of the browser when the page scrolling event is monitored;
[0215] The determination unit is used to execute the method of shielding the webpage operation if the above determination result is yes.
[0216] Optionally, the replacing unit 605 includes:
[0217] A deleting subunit, used to delete the displayed content of the area to be shielded;
[0218] The inserting subunit is used to insert the pictorial display content into the original position of the area to be shielded in the web page file.
[0219] Optionally, the replacing unit 605 further includes:
[0220] The acquisition subunit is used to acquire the original position of the area to be shielded in the web page file.
[0221] Optionally, also include:
[0222] A storage unit is used to store the pictorial display content.
[0223] The present application also provides an electronic device, the electronic device comprising:
[0224] monitor;
[0225] Processor; and
[0226] A memory, wherein the memory is configured to store a web page file including an area to be shielded; when the web page file is opened by a browser, obtain the display content of the area to be shielded; generate pictorial display content based on the display content of the area to be shielded; and replace the display content of the area to be shielded with the pictorial display content.
[0227] The present application provides another method, device and electronic device for shielding web page operations. By generating pictorial display content according to the display content of the area to be shielded, and replacing the display content of the area to be shielded with the pictorial display content, the area to be shielded in the web page can be shielded from mouse operations without calculating the size of the area to be shielded, thereby achieving the effect of improving the web page display speed.
[0228] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0229] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0230] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0231] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0232] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.< / var> < / tt> < / samp> < / pre> < / map> < / legend> < / label> < / kbd> < / h6> < / form> < / fieldset> < / em> < / dfn> < / code> < / cite> < / button> < / blockquote> < / big> < / bdo> < / address>
Claims
1. A method for shielding web page operations, characterized in that: include: Get the display content of the area to be shielded; Generate pictorial display content according to the display content of the area to be shielded; The pictorial display content is a webpage screenshot; Replacing the display content of the to-be-shielded area with the pictorial display content; When loading a web page, it includes: starting to monitor the page scrolling event; when monitoring the page scrolling event, judging whether the area to be shielded is located in the visible area of the browser; if the above judgment result is yes, executing the method of shielding the web page operation.
2. The method for shielding web page operation according to claim 1, characterized in that: The step of replacing the display content of the to-be-shielded area with the pictorial display content includes: Deleting the displayed content of the area to be shielded; The pictorial display content is inserted into the original position of the area to be shielded in the web page file.
3. The method for shielding web page operation according to claim 2, characterized in that: Before inserting the pictorial display content into the original position of the to-be-shielded area in the webpage file, the method further includes: The original position of the area to be shielded in the web page file is obtained.
4. The method for shielding web page operation according to claim 1, characterized in that: After generating the pictorial display content, the method further includes: The imaged display content is stored.
5. A device for shielding web page operations, characterized in that: include: An acquisition unit, used for acquiring display content of the area to be shielded; A generating unit, configured to generate a pictorial display content according to the display content of the area to be shielded; The pictorial display content is a webpage screenshot; A replacement unit, used to replace the display content of the to-be-shielded area with the pictorial display content; The monitoring unit is used to start monitoring page scrolling events; A judging unit, configured to judge whether the area to be shielded is within the visible area of the browser when the page scrolling event is monitored; The determination unit is used to execute the method of shielding the webpage operation if the above determination result is yes.
6. The device for shielding web page operation according to claim 5, characterized in that: The replacement unit comprises: A deleting subunit, used to delete the displayed content of the area to be shielded; The inserting subunit is used to insert the pictorial display content into the original position of the area to be shielded in the web page file.
7. The device for shielding web page operation according to claim 6, characterized in that: The replacement unit also includes: The acquisition subunit is used to acquire the original position of the area to be shielded in the web page file.
8. The device for shielding web page operation according to claim 5, characterized in that: Also includes: A storage unit is used to store the pictorial display content.
9. An electronic device, characterized in that: The electronic device comprises: monitor; Processor; and A memory, wherein the memory is configured to store a web page file including an area to be shielded; when the web page file is opened by a browser, the display content of the area to be shielded is obtained; according to the display content of the area to be shielded, a pictorial display content is generated; the pictorial display content is a screenshot of the web page; the display content of the area to be shielded is replaced with the pictorial display content; when loading a web page, it includes: starting to monitor page scrolling events; when the page scrolling event is monitored, determining whether the area to be shielded is located in the visible area of the browser; if the above determination result is yes, executing a method for shielding a web page operation.
