Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
This repository was archived by the owner on May 22, 2025. It is now read-only.

Location of proxy.html #30

@alvarotrigo

Description

@alvarotrigo

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions