Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location of proxy.html #30

Open
alvarotrigo opened this issue Jun 9, 2014 · 3 comments
Open

Location of proxy.html #30

alvarotrigo opened this issue Jun 9, 2014 · 3 comments

Comments

@alvarotrigo
Copy link

Should the file proxy.html be placed in the same folder as the content you want to load? Like in your examples? Nothing is said at the docs about it.
http://demo.auberger.com/porthole/
http://demo.auberger.com/porthole/proxy.html

Or could it be located anywhere else:
http://demo.auberger.com/controller/myAction
http://demo.auberger.com/controller/proxy

I'm using Laravel framework and I'm not quite sure how to deal with this...
I tried to follow your docs, but still having the message Refused to display...in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'

This is how I'm doing it:
Main page:

<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script type="text/javascript" src="http://sandbox.ternarylabs.com/porthole/js/porthole.min.js"></script>
    <script type="text/javascript">
        function onMessage(messageEvent) {}

        var windowProxy;
        window.onload = function() {
            // Create a proxy window to send to and receive 
            // messages from the iFrame
            windowProxy = new Porthole.WindowProxy(
                'http://192.168.xxx.xxx/monitor/proxy', 'guestFrame');

            // Register an event handler to receive messages;
            windowProxy.addEventListener(onMessage);
        };
    </script>
</head>

<body>

<iframe  src="http://192.168.xxx.xxx/monitor/myAction"  style="border: 0; width: 100%; height: 100%" scrolling="no" id="guestFrame"  name="guestFrame"></iframe>

</body>
</html>

In my iframe:

<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script type="text/javascript" src="http://sandbox.ternarylabs.com/porthole/js/porthole.min.js"></script>
    <script type="text/javascript">
        var windowProxy;
        window.onload = function() {
            // Create a proxy window to send to and receive 
            // messages from the parent
            windowProxy = new Porthole.WindowProxy(
                'http://10.72.xxx.xxx/laravel/public/monitor/proxy');

            // Register an event handler to receive messages;
            windowProxy.addEventListener(function(event) {
                // handle event
            });
        };
    </script>
</head>
<body>My content</body>

</html>
@w3guy
Copy link

w3guy commented Apr 1, 2017

Were you able to fix this issue? Would love to hear your solution.

@IfnotFr
Copy link

IfnotFr commented Apr 19, 2017

No need for the same folder.

Just, the proxy.html should be on the target domain.

@rawatrob
Copy link

not working I had try to open "facebook.com" but getting the same issues

Refused to display...in a frame because it set 'X-Frame-Options'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants