Express.js check if request is made by iframe

Asked

Viewed 35 times

0

How to check if request is made by iframe in "express js."?

Example:

WEBSITE TO:

<iframe src="http://siteb.com/router">

site B:

app.get('/router', (req, res, next) =>
    // logica...
})

The issue is not the bad origin simply check whether it is being loaded from a iframe.

  • I think this is going to be hard to get straight through the express because it is back-end Lauro, has to know if the page is inside a iframe directly on the front end.

  • At the front end I’m wearing window.top !== window.self to check... works bad is not what I seek :(

  • 1

    Can you apply logic to know when it’s valid or not? You can check the source url, if it is different from your knowledge generalize as frame..

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.