How to get reference to a new window of diff origin that is opened from current oneJavaScript open in a new window, not tabHow to get the value from the GET parameters?How do I get the current date in JavaScript?Get the size of the screen, current web page and browser windowOpen a URL in a new tab (and not a new window) using JavaScriptHow do you explicitly set a new property on `window` in TypeScript?How to open a Bootstrap modal window using jQuery?IE9, how to reference window from the popup window opened from the opener, after the opener refreshed himselfCordova InAppBrowser inception: Open a child window inside the original InAppBrowser window?How can I refer to “original” opener window from a chain of opened windows?

Who is "He that flies" in Lord of the Rings?

In The Incredibles 2, why does Screenslaver's name use a pun on something that doesn't exist in the 1950s pastiche?

Is it safe to remove Python 2.7.15rc1 from Ubuntu 18.04?

Open Drain pin not going to GND

Course development: can I pay someone to make slides for the course?

Is Dumbledore a human lie detector?

Does a single fopen introduce TOCTOU vulnerability?

Why are Payments from Apple to New Zealand and Australian bank accounts wire transfers?

Are the guests in Westworld forbidden to tell the hosts that they are robots?

What is the logic behind charging tax _in the form of money_ for owning property when the property does not produce money?

Does it make sense to use a wavelet that is equal to a sine of one period?

Using emission lines to determine redshift of a quasar

Oil draining out shortly after turbo hose detached/broke

Why do I seem to lose data using this bash pipe construction?

How does AFV select the winning videos?

How to show a "node near coord" even when it is out of bounds (with clip = true)?

Why are ambiguous grammars bad?

A life of PhD: is it feasible?

Is Jesus the last Prophet?

Noblesse oblige loanword in German

Parsing text written the millitext font

Have minipage take up entire page height

C++ logging library

Create a cube from identical 3D objects



How to get reference to a new window of diff origin that is opened from current one


JavaScript open in a new window, not tabHow to get the value from the GET parameters?How do I get the current date in JavaScript?Get the size of the screen, current web page and browser windowOpen a URL in a new tab (and not a new window) using JavaScriptHow do you explicitly set a new property on `window` in TypeScript?How to open a Bootstrap modal window using jQuery?IE9, how to reference window from the popup window opened from the opener, after the opener refreshed himselfCordova InAppBrowser inception: Open a child window inside the original InAppBrowser window?How can I refer to “original” opener window from a chain of opened windows?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















This is an Angular project. On my page A, I have a link that links to a page of a different origin, HTML as below:



...
<a href="https://another.origin"> PAGE B </a>
...


A user opened page B into a new window from page A. At this moment, A is still opened.



Now I want to post a message to B, like this referenceOfB.postmessage(msg, bOrigin) So I need to get a reference to B.



I tried
window.open to get a reference to B but get null, not sure if this is the right way to approach it. Can anyone give some hints about how to do that?










share|improve this question






























    0















    This is an Angular project. On my page A, I have a link that links to a page of a different origin, HTML as below:



    ...
    <a href="https://another.origin"> PAGE B </a>
    ...


    A user opened page B into a new window from page A. At this moment, A is still opened.



    Now I want to post a message to B, like this referenceOfB.postmessage(msg, bOrigin) So I need to get a reference to B.



    I tried
    window.open to get a reference to B but get null, not sure if this is the right way to approach it. Can anyone give some hints about how to do that?










    share|improve this question


























      0












      0








      0








      This is an Angular project. On my page A, I have a link that links to a page of a different origin, HTML as below:



      ...
      <a href="https://another.origin"> PAGE B </a>
      ...


      A user opened page B into a new window from page A. At this moment, A is still opened.



      Now I want to post a message to B, like this referenceOfB.postmessage(msg, bOrigin) So I need to get a reference to B.



      I tried
      window.open to get a reference to B but get null, not sure if this is the right way to approach it. Can anyone give some hints about how to do that?










      share|improve this question
















      This is an Angular project. On my page A, I have a link that links to a page of a different origin, HTML as below:



      ...
      <a href="https://another.origin"> PAGE B </a>
      ...


      A user opened page B into a new window from page A. At this moment, A is still opened.



      Now I want to post a message to B, like this referenceOfB.postmessage(msg, bOrigin) So I need to get a reference to B.



      I tried
      window.open to get a reference to B but get null, not sure if this is the right way to approach it. Can anyone give some hints about how to do that?







      javascript angular typescript cross-domain






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 23:05







      Robin

















      asked Mar 24 at 23:01









      RobinRobin

      5212918




      5212918






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can use window.open to spawn a new window - this function returns a reference to the spawned window. You can then post a message to is using
          postmessage.



          https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage



          var w = window.open('https://google.com')
          w.postMessage('hello', "*"); // can use target domain instead of *





          share|improve this answer

























          • How about if I want to refer to the new window that is opened by a user but not by my window.open method?

            – Robin
            Mar 24 at 23:11











          • by a user on your site? You have to intercept his perceived link click and use window.open instead, I would think.

            – jsdeveloper
            Mar 24 at 23:15











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55329414%2fhow-to-get-reference-to-a-new-window-of-diff-origin-that-is-opened-from-current%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You can use window.open to spawn a new window - this function returns a reference to the spawned window. You can then post a message to is using
          postmessage.



          https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage



          var w = window.open('https://google.com')
          w.postMessage('hello', "*"); // can use target domain instead of *





          share|improve this answer

























          • How about if I want to refer to the new window that is opened by a user but not by my window.open method?

            – Robin
            Mar 24 at 23:11











          • by a user on your site? You have to intercept his perceived link click and use window.open instead, I would think.

            – jsdeveloper
            Mar 24 at 23:15















          0














          You can use window.open to spawn a new window - this function returns a reference to the spawned window. You can then post a message to is using
          postmessage.



          https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage



          var w = window.open('https://google.com')
          w.postMessage('hello', "*"); // can use target domain instead of *





          share|improve this answer

























          • How about if I want to refer to the new window that is opened by a user but not by my window.open method?

            – Robin
            Mar 24 at 23:11











          • by a user on your site? You have to intercept his perceived link click and use window.open instead, I would think.

            – jsdeveloper
            Mar 24 at 23:15













          0












          0








          0







          You can use window.open to spawn a new window - this function returns a reference to the spawned window. You can then post a message to is using
          postmessage.



          https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage



          var w = window.open('https://google.com')
          w.postMessage('hello', "*"); // can use target domain instead of *





          share|improve this answer















          You can use window.open to spawn a new window - this function returns a reference to the spawned window. You can then post a message to is using
          postmessage.



          https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage



          var w = window.open('https://google.com')
          w.postMessage('hello', "*"); // can use target domain instead of *






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 24 at 23:14

























          answered Mar 24 at 23:04









          jsdeveloperjsdeveloper

          2,236158




          2,236158












          • How about if I want to refer to the new window that is opened by a user but not by my window.open method?

            – Robin
            Mar 24 at 23:11











          • by a user on your site? You have to intercept his perceived link click and use window.open instead, I would think.

            – jsdeveloper
            Mar 24 at 23:15

















          • How about if I want to refer to the new window that is opened by a user but not by my window.open method?

            – Robin
            Mar 24 at 23:11











          • by a user on your site? You have to intercept his perceived link click and use window.open instead, I would think.

            – jsdeveloper
            Mar 24 at 23:15
















          How about if I want to refer to the new window that is opened by a user but not by my window.open method?

          – Robin
          Mar 24 at 23:11





          How about if I want to refer to the new window that is opened by a user but not by my window.open method?

          – Robin
          Mar 24 at 23:11













          by a user on your site? You have to intercept his perceived link click and use window.open instead, I would think.

          – jsdeveloper
          Mar 24 at 23:15





          by a user on your site? You have to intercept his perceived link click and use window.open instead, I would think.

          – jsdeveloper
          Mar 24 at 23:15



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55329414%2fhow-to-get-reference-to-a-new-window-of-diff-origin-that-is-opened-from-current%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해