# Http request or curl for a named target window?

**URL:** <https://discourse.nodered.org/t/http-request-or-curl-for-a-named-target-window/90039>\
**Category:** General\
**Created:** [7 August 2024 16:02 UTC](https://discourse.nodered.org/t/http-request-or-curl-for-a-named-target-window/90039 "2024-08-07T16:02:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [7 August 2024 16:02 UTC](https://discourse.nodered.org/t/http-request-or-curl-for-a-named-target-window/90039/1 "2024-08-07T16:02:40Z")

</div>

I am trying to use a http request for a url that gets opened in a popup. This popup has a specific window/target name, when I try to access it directly (in the browser or http request), I get a permission denied. It only loads in the popup. Is there some way to spoof/circumvent this to make it work via a http request or curl ?

---

<div class="post-metadata">

**Author:** ![kitori](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kitori](https://discourse.nodered.org/u/kitori)\
**Post date:** [8 August 2024 12:50 UTC](https://discourse.nodered.org/t/http-request-or-curl-for-a-named-target-window/90039/2 "2024-08-08T12:50:10Z")

</div>

You can try open the developer Console in you browser, Tab Network and then copy request with cURL  
i do this sometimes when i'm to lazy to setup all headers in the request node 😉

Is it possible to share the link?

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/1/d10871f0db51f5f93d396e659aa80fee19aa766f.png)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [8 August 2024 15:44 UTC](https://discourse.nodered.org/t/http-request-or-curl-for-a-named-target-window/90039/3 "2024-08-08T15:44:04Z")

</div>

Hi @bakman2

Window objects can have properties added, such as session objects.  
its very possible a session object is being passed to it.

or even cookies (same domain)

```auto
const win = window.open(url,windowName,'height=200,width=150');
win.mySession = <some-magic>

```

Then the source (JS) inside that window, can check for `window.mySession`  
(or `document` - I can't remember how it is stored), and validate its authenticity.

it could also be checking for cookies

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [8 August 2024 18:13 UTC](https://discourse.nodered.org/t/http-request-or-curl-for-a-named-target-window/90039/4 "2024-08-08T18:13:42Z")

</div>

The curl was the hint, it had a specific headers;

`Sec-Fetch-Mode`, ` Sec-Fetch-Dest` and `Sec-Fetch-Site`

@marcus-j-davies there is no window object in nodejs 😉  
there are cookies, but are being passed along, all working now! Thanks.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [8 August 2024 19:43 UTC](https://discourse.nodered.org/t/http-request-or-curl-for-a-named-target-window/90039/5 "2024-08-08T19:43:08Z")

</div>

Sorry - was referring to the original web page passing something to the popup (window) 🫣

But curl to the rescue (I need to use that more)

Edit  
Oh now I get it 😂  
(It’s been a long day - I’m a flight risk today )

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 August 2024 19:43 UTC](https://discourse.nodered.org/t/http-request-or-curl-for-a-named-target-window/90039/6 "2024-08-22T19:43:27Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
