HTMLIFrameElement.fetchpriority
The fetchpriority
property of the
HTMLIFrameElement
interface represents a hint given to the
browser on how it should prioritize the fetch of the iframe document relative
to other iframe documents.
Value
A DOMString
representing the priority hint. Possible values are:
-
high
: Fetch the iframe document at a high priority relative to other iframe documents. -
low
: Fetch the iframe document at a low priority relative to other iframe documents. -
auto
: Default mode, which indicates no preference for the fetch priority. The browser decides what is best for the user.
The fetchpriority
property allows you to signal high or low priority iframe
document fetches. This can be useful when applied to <iframe>
elements to signal iframes that are "less-important" to the user experience
early in the loading process.
The effects of the hint on resource loading is browser-specific so make sure to test on multiple browser engines.
Use it sparingly for exceptional cases where the browser may not be able to infer the best way to load the iframe automatically. Over use can result in degrading performance.
Examples
var iframe = document.createElement("iframe");
iframe.fetchpriority = 'low';
iframe.src = "/";
Specifications
No specification found
No specification data found for api.HTMLIFrameElement.fetchpriority
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.
Browser compatibility
No compatibility data found for api.HTMLIFrameElement.fetchpriority
.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.