컨텐츠로 건너뛰기

Dev Diary

검색
  • Home
  • Profile
  • Contact

날짜별 글 목록: 2024년 01월 04일

Front-end

Javascript 에서 iframe 내부인지 판단

2024년 01월 04일 Quasar 댓글 남기기
function inIframe () {
    try {
        return window.self !== window.top;
    } catch (e) {
        return true;
    }
}

다음 함수를 호출하면 현재 실행중인 javascript 코드 위치의 문서 위치가 iframe 내부인지 아닌지 판단 가능하다.

https://stackoverflow.com/questions/326069/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t

meta

  • 로그인
  • 입력 내용 피드
  • 댓글 피드
  • WordPress.org

SUPERQUASAR

  • How to implement gun shooting sound playback in three.js
  • [KR]How to improve my swimming
  • How to improve my swimming
  • SaaSpocalypse and the Illusion of Zero UI
  • Copyrights Free useful art sharing sites
2024 1월
일 월 화 수 목 금 토
 123456
78910111213
14151617181920
21222324252627
28293031  
« 11월   2월 »
로그인

최신 글

  • How to implement gun shooting sound playback in three.js
  • [KR]How to improve my swimming
  • How to improve my swimming
  • SaaSpocalypse and the Illusion of Zero UI
  • Copyrights Free useful art sharing sites
  • AI Posting
  • Art
  • Back-end
  • Diary
  • Front-end
  • Graphics
  • Language
  • Mathematics
  • Miscellaneous
  • Music
  • Photo
  • Physics
  • Project
  • ProjectManagement
  • Scrape
  • Stock
  • Swimming
  • Travel
  • Unity3D
  • UnrealEngine4
  • 미분류
Proudly powered by WordPress