TWI692232B - Method and device for loading web page based on iframe - Google Patents

Method and device for loading web page based on iframe Download PDF

Info

Publication number
TWI692232B
TWI692232B TW107145503A TW107145503A TWI692232B TW I692232 B TWI692232 B TW I692232B TW 107145503 A TW107145503 A TW 107145503A TW 107145503 A TW107145503 A TW 107145503A TW I692232 B TWI692232 B TW I692232B
Authority
TW
Taiwan
Prior art keywords
browser
content
loading
mixed content
window object
Prior art date
Application number
TW107145503A
Other languages
Chinese (zh)
Other versions
TW202025686A (en
Inventor
林耕葆
Original Assignee
宏碁股份有限公司
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 宏碁股份有限公司 filed Critical 宏碁股份有限公司
Priority to TW107145503A priority Critical patent/TWI692232B/en
Application granted granted Critical
Publication of TWI692232B publication Critical patent/TWI692232B/en
Publication of TW202025686A publication Critical patent/TW202025686A/en

Links

Images

Abstract

A method for loading a web page based on iFrame includes the following steps. A mixed content of an HTTPS web page containing an HTTP content is received. When the HTTP content is to be loaded into an iFrame object, it is detected whether the mixed content is blocked by a browser. When the mixed content is not blocked, the HTTP content is loaded into the iFrame object, and the information in the HTTPS web page and the iFrame object are exchanged by an application interface. When the mixed content is blocked, the HTTP content is loaded into a new window object, and the information in the HTTPS web page and the new window object are exchanged by the application interface.

Description

基於嵌入式視窗的網頁加載方法及其裝置Webpage loading method and device based on embedded window

本發明是有關於一種網頁加載方法,且特別是有關於一種基於嵌入式視窗的網頁加載方法及其裝置。The invention relates to a webpage loading method, and in particular to a webpage loading method and device based on embedded windows.

隨著網際網路技術的不斷發展,越來越多人從網頁獲取資訊和服務,例如瀏覽新聞、看電影、網購等。上述的資訊和服務往往是通過網頁的形式呈現給使用者,當使用者瀏覽一個網頁時,經常需要加載其他網頁(例如是嵌入式視窗)來向使用者展示推薦資訊或即時提示資訊。然而,當嵌入式視窗的網頁內容不符合瀏覽器的傳輸安全協定時,網頁內容將被瀏覽器阻擋,因而使用者無法順利取得相關的網頁內容和服務,影響使用者的體驗。With the continuous development of Internet technology, more and more people obtain information and services from web pages, such as browsing news, watching movies, online shopping, etc. The above information and services are often presented to users in the form of web pages. When users browse a web page, they often need to load other web pages (such as embedded windows) to show the user recommended information or prompt information. However, when the webpage content of the embedded window does not comply with the browser's transmission security protocol, the webpage content will be blocked by the browser, so the user cannot successfully obtain the relevant webpage content and services, affecting the user's experience.

本發明係有關於一種基於嵌入式視窗的網頁加載方法及其裝置,可維持HTTP的內容在HTTPS網頁視窗中的展示與訊息交換,以避免影響使用者的體驗。The invention relates to a method and a device for loading a webpage based on an embedded window, which can maintain the display and exchange of HTTP content in the HTTPS webpage window to avoid affecting the user's experience.

根據本發明之一方面,提出一種基於嵌入式視窗的網頁加載方法,包括下列步驟。取得包含一HTTP內容的一HTTPS網頁的一混合內容。當欲加載HTTP內容至一嵌入式視窗物件中時,偵測混合內容是否被一瀏覽器阻擋。當混合內容未被阻擋時,將HTTP內容加載於嵌入式視窗物件中,並以一應用程式介面交換HTTPS網頁及嵌入式視窗物件中的訊息。當混合內容被阻擋時,將HTTP內容加載於一新視窗物件中,並以應用程式介面交換HTTPS網頁及新視窗物件中的訊息。According to one aspect of the present invention, a web page loading method based on an embedded window is proposed, including the following steps. Acquire a mixed content of an HTTPS web page containing an HTTP content. When HTTP content is to be loaded into an embedded window object, it is detected whether the mixed content is blocked by a browser. When the mixed content is not blocked, the HTTP content is loaded into the embedded window object, and an application program interface is used to exchange messages in the HTTPS web page and the embedded window object. When the mixed content is blocked, the HTTP content is loaded into a new window object, and the information in the HTTPS web page and the new window object is exchanged through the application program interface.

根據本發明之一方面,提出一種基於嵌入式視窗的網頁加載裝置,包括一混合內容阻擋檢測模組、一瀏覽器視窗物件、一HTTP內容加載模組以及一應用程式介面。混合內容阻擋檢測模組用以取得包含一HTTP內容的一HTTPS網頁的一混合內容,並偵測HTTP內容是否被一瀏覽器阻擋。瀏覽器視窗物件包含一嵌入式視窗物件以及一新視窗物件。HTTP內容加載模組用以根據HTTP內容是否被瀏覽器阻擋而將HTTP內容加載於嵌入式視窗物件中或新視窗物件中。應用程式介面用以交換HTTPS網頁及嵌入式視窗物件或新視窗物件中的訊息。According to one aspect of the present invention, a webpage loading device based on an embedded window is provided, including a mixed content blocking detection module, a browser window object, an HTTP content loading module, and an application program interface. The mixed content blocking detection module is used to obtain a mixed content of an HTTPS webpage including an HTTP content and detect whether the HTTP content is blocked by a browser. The browser window object includes an embedded window object and a new window object. The HTTP content loading module is used to load the HTTP content into the embedded window object or the new window object according to whether the HTTP content is blocked by the browser. The application program interface is used to exchange information in HTTPS web pages and embedded window objects or new window objects.

為了對本發明之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下:In order to have a better understanding of the above and other aspects of the present invention, the following examples are specifically described in conjunction with the accompanying drawings as follows:

以下係提出實施例進行詳細說明,實施例僅用以作為範例說明,並非用以限縮本發明欲保護之範圍。以下是以相同/類似的符號表示相同/類似的元件做說明。以下實施例中所提到的方向用語,例如:上、下、左、右、前或後等,僅是參考所附圖式的方向。因此,使用的方向用語是用來說明並非用來限制本發明。The following is an example for detailed description. The example is only used as an example, not intended to limit the scope of the present invention. The following description uses the same/similar symbols to indicate the same/similar components. Directional terms mentioned in the following embodiments, for example: up, down, left, right, front or back, etc., are only directions referring to the drawings. Therefore, the directional terminology is used to illustrate rather than limit the invention.

依照本發明之一實施例,提出一種基於嵌入式視窗(iFrame)的網頁加載方法。嵌入式視窗為創建另外一個網頁的內聯框架,當需要在一網頁視窗中嵌入外部網頁內容時,可在執行網頁視窗的代碼中插入一指令碼,以連接外部網頁的URL位址。According to an embodiment of the present invention, a webpage loading method based on an embedded window (iFrame) is proposed. The embedded window is an inline frame for creating another webpage. When an external webpage content needs to be embedded in a webpage window, a command code can be inserted in the code for executing the webpage window to connect to the URL address of the external webpage.

一般而言,一個含有HTTP內容的HTTPS網頁可稱為混合內容。HTTP內容根據安全性層級可分為被動型混合內容(Passive Mixed content)以及主動型混合內容(Active Mixed content)。對於被動型混合內容,瀏覽器一般預設為只顯示警示訊息,但HTTP內容仍可在HTTPS網頁上加載並展示;而對於主動型混合內容,瀏覽器一般預設為HTTP內容無法直接在HTTPS網頁上加載並展示,尤其是嵌入式視窗內的HTTP內容。因此,當加載的外部視窗的網頁是HTTP內容時,瀏覽器會禁止載入HTTP內容,因而無法在目前的HTTPS網頁視窗中創建另外一個HTTP網頁。In general, an HTTPS web page containing HTTP content can be called mixed content. According to the security level, HTTP content can be divided into passive mixed content (Passive Mixed content) and active mixed content (Active Mixed content). For passive mixed content, the browser generally defaults to displaying only warning messages, but HTTP content can still be loaded and displayed on HTTPS web pages; and for active mixed content, the browser generally defaults to HTTP content not directly on HTTPS web pages Upload and display, especially the HTTP content in the embedded window. Therefore, when the web page of the loaded external window is HTTP content, the browser prohibits the loading of the HTTP content, and thus cannot create another HTTP web page in the current HTTPS web page window.

由於超文本傳輸安全協定(HyperText Transfer   Protocol Secure,HTTPS)相較於HTTP有較高的安全性,為了提高資訊交換的安全性,目前的瀏覽器大多要求HTTPS網頁視窗上除了特定類型的內容外,禁止載入HTTP內容,因此基於嵌入式視窗的網頁加載內容將受到影響。Since HyperText Transfer Protocol Secure (HTTPS) has higher security than HTTP, in order to improve the security of information exchange, most current browsers require HTTPS webpage windows in addition to certain types of content, It is forbidden to load HTTP content, so the loading content of web pages based on embedded windows will be affected.

據此,本發明提出一種基於嵌入式視窗的網頁加載方法,可維持HTTP的內容在HTTPS網頁視窗中的展示與訊息交換,以避免影響使用者的體驗。Accordingly, the present invention proposes a webpage loading method based on an embedded window, which can maintain the display and message exchange of HTTP content in the HTTPS webpage window to avoid affecting the user experience.

請參照第1及2圖,依照本發明一實施例,基於嵌入式視窗的網頁加載方法包括下列步驟S11-S14。在步驟S11中,取得包含一HTTP內容的一HTTPS網頁的一混合內容。在步驟S12中,當欲加載一HTTP內容至一嵌入式視窗物件132中時,偵測HTTP內容是否被一瀏覽器阻擋。在步驟S13中,當混合內容未被阻擋時,將HTTP內容加載於嵌入式視窗物件132中,並以一應用程式介面140交換HTTPS網頁及嵌入式視窗物件132中的訊息。在步驟S14中,當混合內容被阻擋時,將HTTP內容加載於一新視窗物件134中,並以應用程式介面140交換HTTPS網頁及新視窗物件134中的訊息。Please refer to FIGS. 1 and 2, according to an embodiment of the present invention, a web page loading method based on an embedded window includes the following steps S11-S14. In step S11, a mixed content of an HTTPS web page including an HTTP content is obtained. In step S12, when an HTTP content is to be loaded into an embedded window object 132, it is detected whether the HTTP content is blocked by a browser. In step S13, when the mixed content is not blocked, the HTTP content is loaded into the embedded window object 132, and an application interface 140 is used to exchange messages in the HTTPS web page and the embedded window object 132. In step S14, when the mixed content is blocked, the HTTP content is loaded into a new window object 134, and the information in the HTTPS web page and the new window object 134 is exchanged by the application program interface 140.

請參照第1及2圖,依照本發明一實施例,基於嵌入式視窗的網頁加載裝置100包括一混合內容阻擋檢測模組110、一HTTP內容加載模組120、一瀏覽器視窗物件130以及一應用程式介面140。混合內容阻擋檢測模組110用以取得包含一HTTP內容的一HTTPS網頁的一混合內容,並偵測混合內容是否被一瀏覽器阻擋。瀏覽器視窗物件130包含一嵌入式視窗物件132以及一新視窗物件134。HTTP內容加載模組120用以根據混合內容是否被瀏覽器阻擋而將HTTP內容加載於嵌入式視窗物件132中或新視窗物件134中。應用程式介面140用以交換HTTPS網頁及嵌入式視窗物件132或新視窗物件134中的訊息。Referring to FIGS. 1 and 2, according to an embodiment of the present invention, a webpage loading device 100 based on an embedded window includes a mixed content blocking detection module 110, an HTTP content loading module 120, a browser window object 130, and a Application program interface 140. The mixed content blocking detection module 110 is used to obtain a mixed content of an HTTPS webpage including an HTTP content, and detect whether the mixed content is blocked by a browser. The browser window object 130 includes an embedded window object 132 and a new window object 134. The HTTP content loading module 120 is used to load the HTTP content into the embedded window object 132 or the new window object 134 according to whether the mixed content is blocked by the browser. The application program interface 140 is used to exchange HTTPS web pages and messages in the embedded window object 132 or the new window object 134.

在步驟S11及12中,混合內容阻擋檢測模組110用以取得並判斷含有HTTP內容的HTTPS網頁(以下稱混合內容)是否被一瀏覽器阻擋,檢測方式如第5及6圖或第7及8圖所示,稍後再詳細說明。In steps S11 and 12, the mixed content blocking detection module 110 is used to obtain and determine whether an HTTPS web page containing HTTP content (hereinafter referred to as mixed content) is blocked by a browser, and the detection method is as shown in Figs. 5 and 6 or 7 and 7. As shown in Figure 8, we will explain in detail later.

在步驟S13中,當混合內容未被瀏覽器阻擋時,HTTP內容加載模組120將HTTP內容加載於嵌入式視窗物件132中。In step S13, when the mixed content is not blocked by the browser, the HTTP content loading module 120 loads the HTTP content into the embedded window object 132.

請參照第3圖,HTTP內容可加載於嵌入式視窗物件132中,且嵌入式視窗物件132展示於HTTPS網頁視窗131中。此外,應用程式介面140可透過業務通訊模組來交換HTTPS網頁及嵌入式視窗物件132中的訊息。因此,使用者可從嵌入式視窗物件132中順利取得HTTP內容和相關的服務。Referring to FIG. 3, HTTP content can be loaded in the embedded window object 132, and the embedded window object 132 is displayed in the HTTPS web page window 131. In addition, the application program interface 140 can exchange information in the HTTPS web page and the embedded window object 132 through the business communication module. Therefore, the user can successfully obtain HTTP content and related services from the embedded window object 132.

此外,在步驟S14中,當混合內容被瀏覽器阻擋時,HTTP內容加載模組120無法將HTTP內容加載於嵌入式視窗物件132中。此時,HTTP內容加載模組120將HTTP內容加載於一新視窗物件134中。在本實施例中,新視窗物件134例如是以Window.open所開啟的彈出視窗或是新分頁,其程式碼舉例如下: <script LANGUAGE=”javascript”>window.open (‘page.html’, ‘newwindow’, ‘height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no’) //…</script>In addition, in step S14, when the mixed content is blocked by the browser, the HTTP content loading module 120 cannot load the HTTP content into the embedded window object 132. At this time, the HTTP content loading module 120 loads the HTTP content into a new window object 134. In this embodiment, the new window object 134 is, for example, a pop-up window opened by Window.open or a new tab. The code examples are as follows: <script LANGUAGE=“javascript”>window.open ('page.html', 'newwindow','height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no') //…< /script>

請參照第4圖,HTTP內容可加載於一新視窗物件134中,且新視窗物件134與HTTPS網頁視窗131物件為不同的兩個視窗物件。此外,應用程式介面140可透過業務通訊模組來交換HTTPS網頁及新視窗物件134中的訊息。因此,使用者可從新視窗物件134中順利取得HTTP內容和相關的服務。Referring to FIG. 4, HTTP content can be loaded in a new window object 134, and the new window object 134 and the HTTPS web window 131 object are two different window objects. In addition, the application program interface 140 can exchange information in the HTTPS web page and the new window object 134 through the business communication module. Therefore, the user can successfully obtain HTTP content and related services from the new window object 134.

在本實施例中,業務通訊模組與嵌入式視窗物件132或新視窗物件134進行訊息交換,可採用W3C規範的Window.postMessage來完成。Window.postMessage是一個可用於在一視窗內容與另一視窗內容通訊的應用程式介面140,以完成HTTPS網頁與HTTP內容之間的溝通,其程式碼舉例如下: //彈出一個新視窗 var domain = 'http://scriptandstyle.com'; var myPopup = window.open(domain             + '/windowPostMessageListener.html', 'myWindow'); //週期性的發送訊消息 setInterval(function(){   var message = 'Hello!  The time is: ' + (new Date().getTime());   console.log('blog.local:  sending message: ' + message);         //send the message and target URI   myPopup.postMessage(message,domain); },6000);In this embodiment, the business communication module exchanges messages with the embedded window object 132 or the new window object 134, which can be accomplished using Window.postMessage of W3C specification. Window.postMessage is an application program interface 140 that can be used to communicate the content of one window with the content of another window to complete the communication between the HTTPS web page and the HTTP content. The code examples are as follows: //Pop up a new window var domain = 'http://scriptandstyle.com'; var myPopup = window.open(domain ), + +//windowPostMessageListener.html','myWindow'); // Periodically send message messages setInterval(function(){ var message ='Hello ! The time is: '+ (new Date().getTime()); console.log('blog.local: sending message:' + message); // send the message and target URI myPopup.postMessage(message,domain ); },6000);

請參照第5及6圖,其中第5圖繪示判斷混合內容是否被一瀏覽器阻擋的混合內容阻擋檢測模組110的示意圖,第6圖繪示第5圖中判斷混合內容是否被一瀏覽器阻擋的流程示意圖。Please refer to FIGS. 5 and 6, wherein FIG. 5 shows a schematic diagram of the mixed content blocking detection module 110 for determining whether the mixed content is blocked by a browser, and FIG. 6 shows a diagram for determining whether the mixed content is blocked by a browser in FIG. 5 Schematic diagram of the device blocking process.

請參照第5圖,混合內容阻擋檢測模組110包括一加載完成事件傾聽器112以及一加載超時監測單元114。加載完成事件傾聽器112用以傾聽是否觸發一加載完成事件。例如,當視窗的網頁為HTTP網頁時,以嵌入式元素133(例如<iFrame>元素)加載的網頁可正常觸發一加載完成事件。然而,當視窗的網頁為HTTPS網頁時,以嵌入式元素133加載的網頁會被瀏覽器阻擋,因此不會觸發一加載成功事件。因此,以嵌入式元素133加載HTTP內容時,加載超時監測單元114可根據是否觸發一加載成功事件來判斷瀏覽器目前的狀態。上述以嵌入式元素133加載的HTTP內容可為預期要加載的HTTP內容或是特別用於檢測的一網址內的HTTP內容。Referring to FIG. 5, the mixed content blocking detection module 110 includes a loading completion event listener 112 and a loading timeout monitoring unit 114. The loading completion event listener 112 is used to listen to whether a loading completion event is triggered. For example, when the webpage of the window is an HTTP webpage, the webpage loaded with the embedded element 133 (eg, <iFrame> element) can normally trigger a loading completion event. However, when the webpage of the window is an HTTPS webpage, the webpage loaded with the embedded element 133 will be blocked by the browser, so a successful loading event will not be triggered. Therefore, when loading HTTP content with the embedded element 133, the loading timeout monitoring unit 114 can determine the current state of the browser according to whether a loading success event is triggered. The above-mentioned HTTP content loaded with the embedded element 133 may be the HTTP content expected to be loaded or the HTTP content in a URL specifically used for detection.

請一併參照第5及6圖,判斷流程包括S21-S24。首先,在步驟S21中,以嵌入式元素133加載一個HTTP內容時,因為HTTP內容加載在HTTPS網站上會被瀏覽器阻擋,因而無法產生一加載成功事件。因此,在步驟S23中,如果加載超時監測單元114判斷加載已超時而未發生加載成功事件,則標記瀏覽器為阻擋混合內容的狀態。反之,HTTP內容加載在HTTP網站上不會被瀏覽器阻擋,因此在步驟S24中,如果加載超時監測單元114判斷加載未超時而發生加載成功事件,則標記瀏覽器為允許混合內容的狀態。Please refer to Figures 5 and 6 together, the determination process includes S21-S24. First, in step S21, when loading an HTTP content with the embedded element 133, because the HTTP content is blocked on the HTTPS website by the browser, a loading success event cannot be generated. Therefore, in step S23, if the load timeout monitoring unit 114 determines that the load has timed out without a load success event, the browser is marked as a state where mixed content is blocked. On the contrary, the loading of HTTP content will not be blocked by the browser on the HTTP website. Therefore, in step S24, if the loading timeout monitoring unit 114 determines that the loading did not time out and a successful loading event occurs, the browser is marked as a state where mixed content is allowed .

接著,請參照第7及8圖,其中第7圖繪示另一實施例中判斷混合內容是否被一瀏覽器阻擋的混合內容阻擋檢測模組110的示意圖,第8圖繪示第7圖中判斷混合內容是否被一瀏覽器阻擋的流程示意圖。Next, please refer to FIGS. 7 and 8, wherein FIG. 7 illustrates a schematic diagram of the mixed content blocking detection module 110 for determining whether the mixed content is blocked by a browser in another embodiment, and FIG. 8 illustrates the FIG. 7 Schematic diagram of a process for determining whether mixed content is blocked by a browser.

請參照第7圖,混合內容阻擋檢測模組110包括一網路請求模組113、一請求錯誤事件傾聽器115以及一錯誤類型判讀單元117。網路請求模組113用以向一HTTP網址發起一請求。請求錯誤事件傾聽器115用以傾聽是否有一請求錯誤事件。例如,當瀏覽器未設置阻擋機制時,網路請求模組113可成功向HTTP網址發起一請求。然而,當瀏覽器設置阻擋機制時,向HTTP網址發起的請求會被瀏覽器阻擋而產生一請求錯誤事件。因此,錯誤類型判讀單元117可根據是否產生一請求錯誤事件來判斷瀏覽器目前的狀態。在一實施例中,HTTP網址可為預期要加載的HTTP內容的網址,或是特別用於檢測的一HTTP網址。Referring to FIG. 7, the mixed content blocking detection module 110 includes a network request module 113, a request error event listener 115, and an error type interpretation unit 117. The network request module 113 is used to initiate a request to an HTTP URL. The request error event listener 115 is used to listen to whether there is a request error event. For example, when the browser does not set a blocking mechanism, the network request module 113 can successfully initiate a request to the HTTP URL. However, when the browser sets the blocking mechanism, the request to the HTTP URL will be blocked by the browser and a request error event will be generated. Therefore, the error type interpretation unit 117 can determine the current state of the browser according to whether a request error event is generated. In an embodiment, the HTTP URL may be the URL of the HTTP content expected to be loaded, or an HTTP URL specifically used for detection.

請一併參照第7及8圖,判斷流程包括S31-S34。首先,在步驟S31中,網路請求模組113向一HTTP網址發起一請求。在步驟S32中,如果錯誤類型判讀單元117判斷請求被瀏覽器阻擋而產生請求錯誤事件,則在步驟S33中標記瀏覽器為阻擋混合內容的狀態。反之,在步驟S32中,當向HTTP網站的請求未被瀏覽器阻擋時,則在步驟S34中標記瀏覽器為允許混合內容的狀態。Please refer to Figures 7 and 8 together, the determination process includes S31-S34. First, in step S31, the network request module 113 initiates a request to an HTTP URL. In step S32, if the error type interpretation unit 117 determines that the request is blocked by the browser and a request error event is generated, then in step S33, the browser is marked as a state in which mixed content is blocked. Conversely, in step S32, when the request to the HTTP website is not blocked by the browser, then in step S34, the browser is marked as a state that allows mixed content.

另外,在另一實施例中,當瀏覽器內設有一混合內容阻擋檢測模組110時,可直接向混合內容阻擋檢測模組110擷取狀態資料,以判斷瀏覽器處於阻擋混合內容的狀態或允許混合內容的狀態。此外,當瀏覽器的阻擋機制可允許使用者自行關閉時,本發明之加載方法仍可維持HTTP的內容在HTTPS網頁視窗131中的展示與訊息交換,以避免影響使用者的體驗。若瀏覽器的阻擋機制不允許使用者自行關閉時,才以新視窗的方式加載HTTP內容。此外,新視窗可以設定為加載業務完成後就關閉,如此可以不影響使用者對主網頁視窗的操作。In addition, in another embodiment, when a mixed content blocking detection module 110 is provided in the browser, the state data can be directly retrieved from the mixed content blocking detection module 110 to determine whether the browser is in the state of blocking mixed content or The state that allows mixed content. In addition, when the blocking mechanism of the browser allows the user to close by himself, the loading method of the present invention can still maintain the display and exchange of HTTP content in the HTTPS web page window 131 to avoid affecting the user experience. If the blocking mechanism of the browser does not allow the user to close itself, the HTTP content is loaded in a new window. In addition, the new window can be set to close after the loading operation is completed, so that it does not affect the user's operation on the main webpage window.

綜上所述,雖然本發明已以實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為準。In summary, although the present invention has been disclosed as above with examples, it is not intended to limit the present invention. Those with ordinary knowledge in the technical field to which the present invention belongs can make various modifications and retouching without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be deemed as defined by the scope of the attached patent application.

100:基於嵌入式視窗的網頁加載裝置 110:混合內容阻擋檢測模組 112:加載完成事件傾聽器 113:網路請求模組 114:加載超時監測單元 115:請求錯誤事件傾聽器 117:錯誤類型判讀單元 120:HTTP內容加載模組 130:瀏覽器視窗物件 131:HTTPS網頁視窗 132:嵌入式視窗物件 134:新視窗物件 140:應用程式介面 S11-S14、S21-S24、S31-S34:步驟100: Webpage loading device based on embedded window 110: Mixed content blocking detection module 112: Load completed event listener 113: Network request module 114: Load timeout monitoring unit 115: Request error event listener 117: Error type interpretation unit 120: HTTP content loading module 130: Browser window object 131: HTTPS web window 132: Embedded window object 134: New window object 140: Application program interface S11-S14, S21-S24, S31-S34: steps

第1圖繪示依照本發明一實施例的基於嵌入式視窗的網頁加載方法的示意圖。 第2圖繪示依照本發明一實施例的基於嵌入式視窗的網頁加載裝置的示意圖。 第3圖繪示嵌入式視窗物件展示於HTTPS網頁視窗中的示意圖。 第4圖繪示HTTP內容加載於一新視窗物件中的示意圖。 第5圖繪示判斷混合內容是否被一瀏覽器阻擋的混合內容阻擋檢測模組的示意圖。 第6圖繪示第5圖中判斷混合內容是否被一瀏覽器阻擋的流程示意圖。 第7圖繪示另一實施例中判斷混合內容是否被一瀏覽器阻擋的混合內容阻擋檢測模組的示意圖。 第8圖繪示第7圖中判斷混合內容是否被一瀏覽器阻擋的流程示意圖。FIG. 1 is a schematic diagram of a web page loading method based on an embedded window according to an embodiment of the invention. FIG. 2 is a schematic diagram of a webpage loading device based on an embedded window according to an embodiment of the invention. FIG. 3 shows a schematic diagram of the embedded window object displayed in the HTTPS webpage window. FIG. 4 shows a schematic diagram of loading HTTP content in a new window object. FIG. 5 is a schematic diagram of a mixed content blocking detection module for determining whether mixed content is blocked by a browser. FIG. 6 is a schematic flowchart of determining whether the mixed content is blocked by a browser in FIG. 5. FIG. 7 is a schematic diagram of a mixed content blocking detection module for determining whether mixed content is blocked by a browser in another embodiment. FIG. 8 is a schematic flowchart of determining whether the mixed content is blocked by a browser in FIG. 7.

S11-S14:各個步驟 S11-S14: various steps

Claims (12)

一種基於嵌入式視窗的網頁加載方法,包括: 取得包含一HTTP內容的一HTTPS網頁的一混合內容; 當欲加載該HTTP內容至一嵌入式視窗物件中時,偵測該混合內容是否被一瀏覽器阻擋; 當該混合內容未被阻擋時,將該HTTP內容加載於該嵌入式視窗物件中,並以一應用程式介面交換該HTTPS網頁及該嵌入式視窗物件中的訊息;以及 當該混合內容被阻擋時,將該HTTP內容加載於一新視窗物件中,並以該應用程式介面交換該HTTPS網頁及該新視窗物件中的訊息。A web page loading method based on an embedded window, including: obtaining a mixed content of an HTTPS web page including an HTTP content; when the HTTP content is to be loaded into an embedded window object, detecting whether the mixed content is browsed Blocking; when the mixed content is not blocked, loading the HTTP content in the embedded window object, and exchanging messages in the HTTPS web page and the embedded window object with an application interface; and when the mixed content When blocked, the HTTP content is loaded into a new window object, and the application program interface is used to exchange messages in the HTTPS web page and the new window object. 如申請專利範圍第1項所述之方法,其中偵測該混合內容是否被一瀏覽器阻擋之步驟包括: 以一嵌入式元素加載該HTTP內容; 判斷該瀏覽器是否發生一加載成功事件; 當加載已超時而未發生該加載成功事件,標記該瀏覽器為阻擋該混合內容的狀態;以及 當加載未超時而發生該加載成功事件,標記該瀏覽器為允許該混合內容的狀態。The method as described in item 1 of the patent application scope, wherein the step of detecting whether the mixed content is blocked by a browser includes: loading the HTTP content with an embedded element; determining whether a successful loading event occurs in the browser; when If the loading has timed out without the loading success event, the browser is marked as blocking the mixed content; and when the loading has not timed out and the loading success event occurs, the browser is marked with the mixed content allowed state. 如申請專利範圍第1項所述之方法,其中偵測該混合內容是否被一瀏覽器阻擋之步驟包括: 向一HTTP網址發起一請求; 判斷該請求被該瀏覽器阻擋而產生一請求錯誤事件,標記該瀏覽器為阻擋該混合內容的狀態;以及 判斷該請求未被該瀏覽器阻擋,標記該瀏覽器為允許該混合內容的狀態。The method as described in item 1 of the patent application scope, wherein the step of detecting whether the mixed content is blocked by a browser includes: initiating a request to an HTTP URL; determining that the request is blocked by the browser and generating a request error event , Mark the browser as a state that blocks the mixed content; and determine that the request is not blocked by the browser, mark the browser as a state that allows the mixed content. 如申請專利範圍第1項所述之方法,其中偵測該混合內容是否被一瀏覽器阻擋之步驟包括直接向該瀏覽器內的一阻擋檢測模組取得狀態資料。The method as described in item 1 of the patent application scope, wherein the step of detecting whether the mixed content is blocked by a browser includes directly obtaining status data from a blocking detection module in the browser. 如申請專利範圍第1項所述之方法,其中該應用程式介面透過一業務通訊模組來交換該HTTPS網頁及該嵌入式視窗物件中的訊息。The method as described in item 1 of the patent application scope, wherein the application program interface exchanges information in the HTTPS web page and the embedded window object through a business communication module. 如申請專利範圍第1項所述之方法,其中該應用程式介面透過一業務通訊模組來交換該HTTPS網頁及該新視窗物件中的訊息。The method as described in item 1 of the patent application scope, wherein the application program interface exchanges information in the HTTPS web page and the new window object through a business communication module. 一種基於嵌入式視窗的網頁加載裝置,包括: 一混合內容阻擋檢測模組,用以取得包含一HTTP內容的一HTTPS網頁的一混合內容,並偵測該混合內容是否被一瀏覽器阻擋; 一瀏覽器視窗物件,包含一嵌入式視窗物件以及一新視窗物件; 一HTTP內容加載模組,用以根據該混合內容是否被該瀏覽器阻擋而將該HTTP內容加載於該嵌入式視窗物件中或該新視窗物件中;以及 一應用程式介面,用以交換該HTTPS網頁及該嵌入式視窗物件或該新視窗物件中的訊息。A webpage loading device based on an embedded window includes: a mixed content blocking detection module for acquiring a mixed content of an HTTPS webpage including an HTTP content, and detecting whether the mixed content is blocked by a browser; Browser window object, including an embedded window object and a new window object; an HTTP content loading module for loading the HTTP content in the embedded window object according to whether the mixed content is blocked by the browser or In the new window object; and an application program interface for exchanging messages in the HTTPS webpage and the embedded window object or the new window object. 如申請專利範圍第7項所述之裝置,其中該混合內容阻擋檢測模組包括: 一加載完成事件傾聽器,用以傾聽以一嵌入式元素加載該HTTP內容時是否觸發一加載完成事件;以及 一加載超時監測單元,判斷加載已超時而未發生該加載成功事件,標記該瀏覽器為阻擋該混合內容的狀態,或判斷加載未超時而發生該加載成功事件,標記該瀏覽器為允許該混合內容的狀態。The device as described in item 7 of the patent application scope, wherein the mixed content blocking detection module includes: a load completion event listener to listen to whether a load completion event is triggered when the HTTP content is loaded with an embedded element; and A loading timeout monitoring unit, judging that the loading has timed out without the loading success event, marking the browser as blocking the mixed content, or judging that the loading has not timed out and the loading success event occurred, marking the browser as The state of the mixed content is allowed. 如申請專利範圍第7項所述之裝置,其中該混合內容阻擋檢測模組包括: 一網路請求模組,向一HTTP網址發起一請求; 一請求錯誤事件傾聽器,;以及 一錯誤類型判斷單元,判斷該請求被該瀏覽器阻擋而產生一請求錯誤事件,標記該瀏覽器為阻擋該混合內容的狀態,或判斷該請求未被該瀏覽器阻擋,標記該瀏覽器為允許該混合內容的狀態。The device as described in item 7 of the patent application scope, wherein the mixed content blocking detection module includes: a network request module that initiates a request to an HTTP URL; a request error event listener; and an error type determination Unit, determining that the request is blocked by the browser and generating a request error event, marking the browser as blocking the mixed content, or determining that the request is not blocked by the browser, marking the browser as allowing the mixed content status. 如申請專利範圍第7項所述之裝置,其中該混合內容阻擋檢測模組直接設置在該瀏覽器內。The device as described in item 7 of the patent application scope, wherein the mixed content blocking detection module is directly provided in the browser. 如申請專利範圍第7項所述之裝置,其中該應用程式介面透過一業務通訊模組來交換該HTTPS網頁及該嵌入式視窗物件中的訊息。The device as described in item 7 of the patent application scope, wherein the application program interface exchanges information in the HTTPS web page and the embedded window object through a business communication module. 如申請專利範圍第7項所述之裝置,其中該應用程式介面透過一業務通訊模組來交換該HTTPS網頁及該新視窗物件中的訊息。The device as described in item 7 of the patent application scope, wherein the application program interface exchanges information in the HTTPS web page and the new window object through a business communication module.
TW107145503A 2018-12-17 2018-12-17 Method and device for loading web page based on iframe TWI692232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107145503A TWI692232B (en) 2018-12-17 2018-12-17 Method and device for loading web page based on iframe

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107145503A TWI692232B (en) 2018-12-17 2018-12-17 Method and device for loading web page based on iframe

Publications (2)

Publication Number Publication Date
TWI692232B true TWI692232B (en) 2020-04-21
TW202025686A TW202025686A (en) 2020-07-01

Family

ID=71132636

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107145503A TWI692232B (en) 2018-12-17 2018-12-17 Method and device for loading web page based on iframe

Country Status (1)

Country Link
TW (1) TWI692232B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120246017A1 (en) * 2009-12-28 2012-09-27 Google Inc. Distributing content

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120246017A1 (en) * 2009-12-28 2012-09-27 Google Inc. Distributing content

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
apachenick, "HTTPS iframe shows as HTTP (mixed content)", stackoverflow, https://stackoverflow.com/questions/32458509/https-iframe-shows-as-http-mixed-content?rq=1&rq=1, 2015/09/08. *
georgephillips, "How to allow http content within an iframe on a https site", stackoverflow, https://stackoverflow.com/questions/18327314/how-to-allow-http-content-within-an-iframe-on-a-https-site/25189561#25189561, 2017/01/05. *

Also Published As

Publication number Publication date
TW202025686A (en) 2020-07-01

Similar Documents

Publication Publication Date Title
US11580185B2 (en) Method and apparatus of processing invalid user input search information
US9628349B2 (en) Interactivity analyses of web resources based on reload events
US9544295B2 (en) Login method for client application and corresponding server
US8417772B2 (en) Method and system for transferring content from the web to mobile devices
WO2018126938A1 (en) Data acquisition method and device
JP3954030B2 (en) Method and system for protecting user privacy when using applications
US8886819B1 (en) Cross-domain communication in domain-restricted communication environments
WO2019037417A1 (en) Webpage data crawling method and apparatus, webpage data crawling platform, and storage medium
US8738711B2 (en) System and method for redirecting client-side storage operations
CN101273331B (en) Method of controlling a browser window
US20210224348A1 (en) Determining whether an authenticated user session is active for a domain
TWI434192B (en) Directly through the gateway device automatically in the web browser to insert the toolbar tool method
US10565385B1 (en) Substitute web content generation for detection and avoidance of automated agent interaction
US20060265380A1 (en) Methods, systems, and computer program products for preventing double form submission at a user agent
CN103955501A (en) Webpage two-way collaborative browsing method
CN110580318A (en) Information display method and device and storage medium
US20210192563A1 (en) Webpage advertisement anti-blocking method, content delivery network, and client terminal
CN104361130B (en) Method for searching local area network or specified network segment equipment in webpage
WO2015058614A1 (en) Bookmark storage method and device, and method and device for determining bookmark to be browsed
TWI692232B (en) Method and device for loading web page based on iframe
US7831732B1 (en) Network connection utility
JP5255006B2 (en) Web system, method and program
US8082487B2 (en) Method to prevent access of web applications from bookmarked links
TWI726383B (en) Method of identity identification for initiating wepage by messaging service
KR100683901B1 (en) Monitoring method of an web contents, computer readable medium storing the same, and monitoring system for the performing the same