Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8886721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:37:35+00:00 2026-06-14T21:37:35+00:00

I have two local .html files in the same folder. One page opens a

  • 0

I have two local .html files in the same folder. One page opens a window with the other page, and attempts to call a function in the newly opened window. However, the function call fails, and I get this in the console:

Unsafe JavaScript attempt to access frame with URL file:///***/A.html from frame with URL file:///***/B.html. Domains, protocols and ports must match.

This happens on both Chrome and Webkit (Mac). Is there any way I can either: disable the cross-domain checks for the file:// protocol, or call a javascript function in a different local file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:37:36+00:00Added an answer on June 14, 2026 at 9:37 pm

    You can use window.postMessage to do something like this:

    The initial window html file:

    <!DOCTYPE html>
    <html>
        <head>
            <script>
                var otherWindow;
                function openOther() {
                    otherWindow = window.open("other.html", "otherWindow");
    
                }
    
                function otherFunc() {
                    otherWindow.postMessage("otherFunc", "*");
                }
            </script>
        </head>
        <body>
            <div onclick="openOther()">Open the other window</div>
            <div onclick="otherFunc()">Call the other window's function</div>
        </body>
    </html>
    

    Html for the second window:

    <!DOCTYPE html>
    <html>
        <head>
            <script>
                window.addEventListener("message", function(event) {
                    alert("The other window's function executed.");
                }, false);
            </script>
        </head>
        <body>
            <div>This is the other window.</div>
        </body>
    </html>
    

    Here’s a good reference for window.postMessage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two local .html files in the Resources folder. I'm trying to load
I have a local branch work, where I created two new files a.py, b.py
I have two files, one is in the webroot, and another is a bootstrap
Currently in my application I have two possible textboxes. One for a local image
I have two master pages and a content page. On my local machine this
Say I have two web servers, one local development and one live. Under SVN
I currently have two files, register.html and register.jsp. The HTML file asks the user
in /usr/local i now have two mysql folders: mysql-5.1.34-osx10.5-x86 mysql-5.1.37-osx10.5-x86_64 is it possible to
I have two git repositories: report.git (Master on remote location) cloned.git (Local) I lost
Suppose you have two linked servers called Local and Remote respectively. Is there a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.