HTML အကိုးအကား

အက္ခရာဖြင့် HTML HTML အမျိုးအစားအလိုက် HTML Browser ပံ့ပိုးမှု HTML အရည်အချင်းများ HTML ကမ္ဘာလုံးဆိုင်ရာ အရည်အချင်းများ HTML ပွဲများ HTML အရောင်များ HTML Canvas HTML အသံ/ဗီဒီယို HTML အက္ခရာအစုံများ HTML Doctypes HTML URL ကုဒ် HTML ဘာသာစကားကုဒ်များ HTML နိုင်ငံကုဒ်များ HTTP မက်ဆေ့ခ်ျများ HTTP နည်းလမ်းများ PX မှ EM Converter ကီးဘုတ်ဖြတ်လမ်းများ


HTML <iframe> sandbox ရည်ညွှန်းချက်

❮ HTML <iframe> တဂ်

ဥပမာ

အပိုကန့်သတ်ချက်များပါရှိသော <iframe>

<iframe src="demo_iframe_sandbox.htm" sandbox></iframe>

အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။


အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

sandboxရည်ညွှန်းချက်သည် iframe ရှိ အကြောင်းအရာအတွက် ကန့်သတ်ချက်များ အပိုအစုံကို ဖွင့်ပေးသည်

ရည်ညွှန်းချက်ရှိသော အခါ sandbox၊ ၎င်းသည်-

  • အကြောင်းအရာကို တစ်မူထူးခြားသော မူလအစမှ ဖြစ်သည်ဟု မှတ်ယူပါ။
  • block form တင်သွင်းခြင်း။
  • block script ကိုလုပ်ဆောင်ခြင်း။
  • API များကို ပိတ်ပါ။
  • အခြား browsing အကြောင်းအရာများကို ပစ်မှတ်ထားရန် လင့်ခ်များကို တားဆီးပါ။
  • <embed>ပလပ်အင်များ (မှတဆင့် ၊ <object> <applet>၊ သို့မဟုတ် အခြား) အသုံးပြုခြင်းမှ အကြောင်းအရာကို တားဆီးပါ
  • ၎င်း၏ ထိပ်တန်းအဆင့် ရှာဖွေမှုအကြောင်းအရာကို လမ်းညွှန်ရန် အကြောင်းအရာကို တားဆီးပါ။
  • အလိုအလျောက် အစပျိုးထားသော အင်္ဂါရပ်များကို ပိတ်ဆို့ခြင်း (ဥပမာ- ဗီဒီယိုကို အလိုအလျောက် ဖွင့်ခြင်း သို့မဟုတ် ဖောင်ထိန်းချုပ်မှုကို အလိုအလျောက် အာရုံစိုက်ခြင်းကဲ့သို့)

ရည်ညွှန်းချက် ၏တန်ဖိုးသည် sandboxဗလာဖြစ်နိုင်သည် (ထို့နောက် ကန့်သတ်ချက်များအားလုံးကို အသုံးချသည်) သို့မဟုတ် သီးခြားကန့်သတ်ချက်များကို ဖယ်ရှားမည့် ကြိုတင်သတ်မှတ်ထားသော တန်ဖိုးများစာရင်းတွင် နေရာလွတ်များခွဲထားသည်။


Browser ပံ့ပိုးမှု

ဇယားရှိ နံပါတ်များသည် attribute ကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးပါသည်။

Attribute
sandbox 4.0 10.0 17.0 5.0 15.0


အထားအသို

<iframe sandbox="value">

ရည်ညွှန်းတန်ဖိုးများ

Value Description
(no value) Applies all restrictions
allow-forms Allows form submission
allow-modals Allows to open modal windows
allow-orientation-lock Allows to lock the screen orientation
allow-pointer-lock Allows to use the Pointer Lock API
allow-popups Allows popups
allow-popups-to-escape-sandbox Allows popups to open new windows without inheriting the sandboxing
allow-presentation Allows to start a presentation session
allow-same-origin Allows the iframe content to be treated as being from the same origin
allow-scripts Allows to run scripts
allow-top-navigation Allows the iframe content to navigate its top-level browsing context
allow-top-navigation-by-user-activation Allows the iframe content to navigate its top-level browsing context, but only if initiated by user

နောက်ထပ် ဥပမာများ

ဥပမာ

ဖောင်တင်ပြခြင်းကို ခွင့်ပြုသော <iframe> sandbox တစ်ခု-

<iframe src="demo_iframe_sandbox_form.htm" sandbox="allow-forms"></iframe>

ဥပမာ

script များကိုခွင့်ပြုသော <iframe> sandbox တစ်ခု-

<iframe src="demo_iframe_sandbox_origin.htm" sandbox="allow-scripts"></iframe>

❮ HTML <iframe> တဂ်