Abstract:
A method to insert in any Web page visited by a user, the HTML and JavaScript code allowing the insertion of an icon over the browser and the corresponding code to allow its opening to show corresponding information or an advertising panel.

Description:
CROSS REFERENCE TO RELATED APPLICATION 
       [0001]    This application claims priority to Italian Patent Application No. RM2014A000458, filed Aug. 5, 2014, the entire contents of which are hereby incorporated by reference as if fully set forth herein. 
       TECHNICAL FIELD 
       [0002]    The present invention relates to a method for the real-time automatic modification on the server side of a Web page to visualize a content superposed to the Web page. 
         [0003]    More in detail, the present invention concerns a method that is able to insert into any Web page visited by the user by mobile phone, tablet, or PC, the HyperText Markup Language (HTML) and JavaScript code allowing the insertion of an icon over a browser and the corresponding code allowing the opening thereof, and showing the corresponding information or advertisement banner. 
       BACKGROUND 
       [0004]    No products are known to the inventors which are able to modify Web pages on-the-fly to obtain the visualization of a content superposed onto a Web page. 
         [0005]    The main problem is the possibility of inserting into any Web page visited by the user by mobile phone, tablet, or PC, the HTML, and JavaScript code allowing the insertion of an icon (possibly rotatable) over a browser and the corresponding code allowing the opening thereof, and showing the corresponding information or advertisement banner. 
         [0006]    The difficulty is represented in automatically finding and in real time the most appropriate lines of code of any Web page wherein one can insert, in a transparent way and in real time, the lines of code without interfering with the normal functioning of the Web page. 
         [0007]    If the new code was not inserted in the right place, the original Web page could be not visualized correctly any longer or not even visualized at all. 
         [0008]    Another technical problem consists in visualizing both the icon and the banner over all the elements constituting the Web page and therefore superposing onto the page and appearing in the foreground. 
         [0009]    U.S. Patent Application Publication No. 2007/0180147A1 describes a method for the modification of a Web page in real time. This document teaches adding an advertising banner over the heading of a Web page, thus modifying the layout of the original page by dividing it into two separate frames, wherein an advertising banner is inserted (on the top) in the first frame and the original page is inserted in the second frame. Therefore, it deals with an invasive content with respect to the Web page, because it modifies its original layout. 
       SUMMARY 
       [0010]    It is an object of the present invention to provide a method solving at least partially the problems of the prior art. 
         [0011]    The present invention describes a method for the real time automatic modification on the server side of a Web page to visualize a content superposed to the Web page on a screen of a computer electronic device, in particular a mobile computer device, characterized in that the following steps are executed: 
         [0012]    A. intercepting a Web page requested by the computer electronic device; 
         [0013]    B. searching for the string “&lt;head&gt;” or “&lt;/head&gt;” in the code of the Web page of step A, and 
         [0014]    B1. if the string is present, inserting a header code relevant to the superposed content and setting the HTML “z-index” parameter, as defined by the World Wide Web Consortium (W3C), to its maximum value; 
         [0015]    B2. if the string is not present, creating the section “&lt;head&gt;” or “&lt;/head&gt;” in the code of the Web page of step A and executing step B1; 
         [0016]    C. searching for the string “&lt;body&gt;” or “&lt;/body&gt;” in the code of the Web page of step A or B, and 
         [0017]    C1. if both the “&lt;body&gt;” and “&lt;/body&gt;” strings are present, inserting a body code relevant to the superposed content immediately before the “&lt;/body&gt;” string; 
         [0018]    C2. if the second string is not present, creating a body section starting with the “&lt;body&gt;” string and ending with the “&lt;/body&gt;” string in the code of the Web page and executing step C1; 
         [0019]    D. sending to the computer electronic device the Web page with the modification of steps B and C; 
         [0020]    wherein if steps B2 or C2 cannot be executed, the Web page of step A is not modified. 
         [0021]    According to an aspect of the invention, step B includes the preliminary sub-step: 
         [0022]    B0. Hiding all the commented code lines in the code of the Web page, to find a true section “&lt;head&gt;” or “&lt;/head&gt;”. 
         [0023]    According to an aspect of the invention, step C includes the preliminary sub-step: 
         [0024]    C0. Hiding all the commented code lines in the code of the Web page, to find a true string “&lt;body&gt;” or “&lt;/body&gt;”. 
         [0025]    According to an aspect of the invention, between step A and B, the following steps are executed: 
         [0026]    D. obtaining the User Agent information of the computer electronic device; 
         [0027]    E. utilizing the User Agent information to distinguish the data traffic relevant to a browser and the data traffic relevant to an application, and discarding application data and choosing the correct headers. 
         [0028]    It is subject matter of the present invention a computer program, characterized in that it comprises code means that, when they are executed by a server, realize the method according to the invention. 
         [0029]    It is subject matter of the present invention a non-transitory memory medium readable by a computer, having a computer program stored on it, characterized in that the computer program is the computer program according to the invention. 
         [0030]    It is subject matter of the present invention a server, comprising code means configured to execute the method according to the invention. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0031]    The invention will be now described by way of illustration but not by way of limitation, with particular reference to the drawings of the annexed Figures, wherein: 
           [0032]      FIG. 1  shows a flowchart illustrating an embodiment of the present invention; 
           [0033]      FIG. 2  shows an example of content (an icon) superposed according to the invention; 
           [0034]      FIG. 3  shows an example of content obtained by clicking on the icon of  FIG. 2 ; 
           [0035]      FIG. 4  shows a second example of content obtained by clicking on the icon of  FIG. 2 ; and 
           [0036]      FIG. 5  shows a network architecture that realizes the method according to the invention. 
       
    
    
     DETAILED DESCRIPTION 
       [0037]    According to the invention, a server intercepts a Web page requested by a user, executes in real time the modifications to the page, which are needed to insert the HTML and JavaScript code according to the invention, and sends the modified page to the user. 
         [0038]    The insertion of the code according to the invention in the Web page occurs in an automatic way and follows an intelligent algorithm that identifies the correct sections, which vary from one HTML type to another, wherein the code relevant to the content to superpose is inserted, without modifying the original contents of the processed page. 
         [0039]    Making reference to  FIG. 1 , the method verifies that the page is not in a black list, and the method proceeds to verify that it does deal with a text page. 
         [0040]    Afterwards, the first section that the algorithm seeks is the headers page section identified by the HTML tag “&lt;head&gt;”. At this point, once determined and personalized depending on the User Agent information of the device so as to modify only requests made by a Web browser and not by programs and/or applications, a code with a meta tag HTML is inserted, which defines the zoom ratio by which the page is to be visualized initially. The following HTML code for the default case is an example: &lt;meta name=“viewport” content=“width=device-width,initial-scale=0.84,minimum-scale=0.1,maximum-scale=10.0,user-scalable=yes”/&gt;. 
         [0041]    The User Agent information is used to identify the device and, if needed for that particular device, insert particular parameters of the &lt;meta&gt; tag into the &lt;head&gt; section for the correct visualization of the content. The User Agent information is also used to distinguish the traffic of the browser from the traffic of the applications, and not to modify the data traffic of an application. 
         [0042]    Thereafter, the HTML tag “&lt;body&gt;” is identified and immediately after the tag, inserts the code (HTML, Cascading Style Sheet (CSS), and JavaScript) that defines the geometry of the banner according to the invention, the semi-transparent superposed icon, and the modes of opening and visualizing the panel when the superposed icon is clicked on. The utilized algorithm also solves the problem of visualizing both the superposed icon and the banner in the foreground with respect to the Web page and therefore leaving the content underneath by using the HTML “z-index” parameter and assigning high values to it. In an embodiment, in the case of the superposed icon, this is realized in semi-transparent mode to not disturb the visualization of the background page, while the banner is opaque with respect to the background page because it is activated upon user need. 
         [0043]    At the end of the page, the “&lt;/body&gt;” tag is identified, and immediately before the tag, the JavaScript activation code of the content is inserted. 
         [0044]    After having inserted the code into the Web page, the Web page is sent to the user in a transparent way and with a delay that is practically null with respect to the original page. 
         [0045]    The algorithm of inserting the code according to the invention into any page must take into account, in real time, of the many different methods of writing the pages and adapting automatically to any page type. 
         [0046]    In the following these algorithms are explained in more detail, with reference to  FIG. 1 . 
         [0047]    There are Web pages that do not have &lt;body&gt; or &lt;/body&gt; tags, nor &lt;head&gt; or &lt;/head&gt; tags, either by choice of architecture or, more commonly, by error. The method according to the invention needs to use these tags to correctly insert its code in the context of the Web page. Moreover, there are cases wherein in the same page more than one &lt;body&gt; or &lt;head&gt; tag is present and the algorithm must understand which is the right one. There are also cases wherein some tags (&lt;body&gt; or &lt;head&gt;) are part of a comment, and the method must identify the correct tags and not select the tags that are part of a comment. 
         [0048]    The method utilizes adaptive steps to handle these situations, creating the right prerequisite to insert in the correct place in the page. The method, in some cases, automatically corrects the errors in the syntax of the pages. In other cases, the method adds some lines of code in the page to be able to insert itself transparently and without modifying the layout of the original page. 
         [0049]    In the case where some fundamental tags for the correct use of the invention are lacking, as for example the &lt;head&gt; or &lt;body&gt; and &lt;/body&gt; tags, the invention automatically seeks the best position to insert them. If the correct position could not be found or there is a risk that the normal functioning of the page is jeopardized, then the page is not modified. There are various cases: 
         [0050]    (1) Lack of &lt;head&gt; and &lt;/head&gt; tags. Depending on the page structure, these tags are inserted before the &lt;body&gt; tag if it exists, otherwise just after the &lt;html&gt; tag. 
         [0051]    (2) Lack of &lt;head&gt; tag but presence of &lt;/head&gt; tag. Depending on the page structure, the &lt;head&gt; tag is inserted immediately before the &lt;/head&gt; tag or just after the &lt;html&gt; tag. 
         [0052]    (3) Lack of &lt;body&gt; tag. It is inserted immediately after the &lt;/head&gt; tag. 
         [0053]    (4) Lack of &lt;/body&gt; tag. It is inserted immediately before the &lt;/html&gt; tag. 
         [0054]    (5) Lack of &lt;body&gt; and &lt;/body&gt; tags. They are inserted immediately after the &lt;/head&gt; tag. 
         [0055]    (6) It is impossible to find a point for the insertion of the &lt;head&gt;, &lt;body&gt;, or &lt;/body&gt; tags. There are rare cases wherein because of the lack of these tags, it is preferable not to modify the page. In these cases, the Web page is sent to the user without modifying it. 
         [0056]    Examples of the superposition of contents onto a Web page are given in  FIGS. 2-4 .  FIG. 2  shows a Web page  100  with a superposed icon  110  in the left frame.  FIG. 3  shows a Web page  100 , in which one obtains a banner by clicking on a superposed icon  110 ′.  FIG. 4  shows a Web page  100 , in which one obtains a different banner by clicking on a superposed icon  110 ″. The advantages of the solution according to the invention include the following. 
         [0057]    The icon, which may be a logo, is superposed over the Web page. It is not invasive and does not hide the contents of the underlying page, because it flows rapidly when scrolling the Web page, it is semi-transparent, and is positioned at the edge of the page. It is movable, in the sense that it is a rotating and twinkling image. The user is attracted to the icon without being disturbed by it. 
         [0058]    The menu or window that appears after clicking on the icon is esthetically pleasant and designed following the specification of the customer. It flows rapidly during the vertical or horizontal scrolling of the screen and allows an easy visualization of the underlying contents. It is composed by two “iframes”, i.e., panels that are dynamically fed with suitable editors by the customer. It provides configurable information such as, for example, the amount of data traffic saved because of an optional data compression mechanism, find in page, or a bookmark. 
         [0059]    The system has a high performance and runs in the “cloud” by using scalable open systems. It can be also installed and managed within the information network of the customers. 
         [0060]    The activation of the service in the framework of the mobile networks 2.5G, 3G, 3.5G, and 4G (or LTE), can occur both in the standard mode (set up care of the telephone company and/or auto-configuring SMS) and by applications (iPhone® or Android®). In Wi-Fi, the activation occurs by suitable push mechanisms. 
         [0061]    In  FIG. 5 , a network architecture is shown, which implements the method according to the invention. 
         [0062]    To access the superposed content according to the invention, the user will have to configure his own device to pass through the proxy containing the content. The configuration can be made manually on the device or automatically and in a way transparent to the user if the latter accedes from the Wi-Fi network or mobile network operator. The user enters into the browser the Uniform Resource Locator (URL) of the Web page he wants to visit, for example “www.ebay.it.” The request arrives via Internet to the VIP (Virtual IP) of the currently active load balancer, which routes the request towards one of the application servers wherein the service according to the invention resides. This requests to the Ebay® servers (at www.ebay.it) and processes the Web page according to the method, and then passes the Web page to the user who receives the requested Web page with the superposed icon according to the invention. 
         [0063]    If the user selects the icon, the panel of the multimedia service according to the invention will open. 
         [0064]    With respect to the above-mentioned U.S. Patent Application Publication No. 2007/0180147A1, the present invention provides a semi-transparent and superposed content which is superposed “over” the Web page, in an upper “layer” (in the third dimension), without modifying the layout of the original Web page. A three-dimensionality level is added to the Web page and contents placed within an “iframe” (icon or space superposed to the original Web page) are inserted over the page. As explained above, by “over” the z-coordinate is meant, wherefrom the use of the “z-index” comes, which is a CSS property defined in the W3C standard (http://www.w3.org/wiki/CSS/Properties/z-index). The visualized content is superposed over the Web page and retains the same position on the screen of the Web browser and is visible even when the page is “scrolled” downward, upward, rightward, or leftward. 
         [0065]    Moreover, the method according to the invention allows any type of content to be inserted in this second layer (being an “iframe”) such as images, text, video, etc. This content will be always visible even if the page were “scrolled” downward, upward, rightward, or leftward. The concept can be considered analogous to the Picture In Picture (PIP) of some television sets. Moreover, it can be said that the algorithm of the U.S. Patent Application Publication No. 2007/0180147A1 has been thought in two dimensions, while the present invention is thought in three dimensions. 
         [0066]    Most of the method according to the invention is dedicated to finding the right point in the code of the Web page to insert the new code (HTML5, CSS3, and JavaScript). Because a Web page standard does not exist to insert the code, not all Web pages can be modified at the code level in the same manner. A specific command does not exist which is suitable to find these insertion points and therefore, simple code libraries cannot be used. The present method achieves this goal for the situation of changing the coding of the Web pages. 
         [0067]    One goal of the method according to the invention has been to keep visualization of the hosting Web page unaltered and not modify the experience of the user in any way. On the contrary, the algorithm described in U.S. Patent Application Publication No. 2007/0180147A1 inserts the code within the “&lt;head&gt;” tag to make the wanted code appear before the original Web page, therefore shifting the original Web page downwards. The present invention method, instead, distinguishes what has to be inserted at the beginning of the “&lt;body&gt;” tag and just before the end of the body section with the “&lt;/body&gt;” tag, therefore at the beginning and the end of the body section, to manage all the possible cases of Web pages. 
         [0068]    Referring now to the “z-index”, it is commonly used in the composition of Web pages and allows a third dimension of placing the elements of a Web page and is part of the W3C standard. It serves to visualize a portion of a Web page over another portion, such as the “send forward/backward” used in many graphical editors. 
         [0069]    The simple use of the z-index as such does not guarantee the “superposition” of the additional content over the original Web page. In some cases, the user would see his content passing “below” some object of the hosting page. 
         [0070]    To avoid this problem, a particular configuration of the Document Object Model (DOM) variables has been performed. The reason is given in the following. 
         [0071]    (1) The “z-index” can have negative and positive values and its maximum value is that of a 32-bit integer, i.e., equal to 2147483647, which is a standard for almost all the browsers on the market. The invention sets the “z-index” of the iframe to the maximum value supported by the Web browsers. 
         [0072]    (2) Most part of the Web sites implement pages with objects that rarely exceed a “z-index” value of 100 or 1000, and therefore the invention sets the “z-index” to the maximum possible value to keep the objects over all the other elements constituting the hosting Web page. 
         [0073]    (3) There are limiting cases, wherein the hosting Web page has some objects with a “z-index” value that is at its maximum value. In such cases, if the content of the hosting Web page has the same “z-index” level, the latter prevails. However, the method according to the invention “prevents” at the DOM level such a prevalence of the objects of the hosting Web page and, in the case there are elements with the maximum “z-index”, places the creation of the elements constituting the “iframe” in such a way to create it as the last one with respect to all the other elements of the hosting Web page. This acts in such a way that the additional object according to the invention comes out to have always a higher priority, even if with the same “z-index”, with respect to the elements of the hosting Web page, and therefore is visualized in any case over all the other objects of the hosting Web page. 
         [0074]    Inserting the additional elements in such a way that the highest priority with respect to the others means that they must be constructed in the DOM last. This is performed by placing the additional code exactly before the body closing tag (“&lt;/body&gt;”) so as to be sure that there are no other objects to be constructed by the Web browser. 
         [0075]    Finally, the content that is inserted in the iframe can be the content of a captive portal page. When one exits the captive portal, the content follows the iframe which is inserted in the hosting Web page. 
         [0076]    In the foregoing, aspects of the invention have been described and variations have been suggested, but it is to be understood that those skilled in the art will be able to change and modify the disclosed invention without so departing from the scope of the enclosed claims.