Software Archive
Read-only legacy content
17061 Discussions

Is there a way to have a ("X-Frame-Options: SAMEORIGIN") website ?

yarek_c_
Beginner
1,364 Views

Is there a way to have a ("X-Frame-Options: SAMEORIGIN") website ? ( in phonegap / crosswalk)

or in opthers terms : I want to embed google.com inside my phonegap application: is this possible ? (I tried with iframe and no way)

 

0 Kudos
1 Reply
Rakshith_K_Intel
Employee
1,364 Views

You can use the Cordova In-App-Browser plugin to open external websites. This will pop open a modal window with the website you specify.

 

Below is example code to open google.com, make sure you have checked the "In App Browser" plugin from the Intel XDK -> project settings - > Plugins

<!DOCTYPE html>
<html>
    <head>
        <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=no">
        <script src="cordova.js"></script>
        <script>   
function openIAB(){
    var url = "http://google.com";
    window.open(url, "_blank", "location=yes");
}            
        </script>    
    </head>
    <body>
        <button onclick="openIAB()">Open Google</button>
    </body>
</html>

documentation for In App Browser cordova plugin: https://github.com/apache/cordova-plugin-inappbrowser

0 Kudos
Reply