MCPcopy Index your code
hub / github.com/ampproject/amphtml / getBrowserCapabilitiesBitmap

Function getBrowserCapabilitiesBitmap

ads/google/a4a/utils.js:963–981  ·  view source on GitHub ↗

* Returns a bitmap representing what features are supported by this browser. * @param {!Window} win * @return {number}

(win)

Source from the content-addressed store, hash-verified

961 * @return {number}
962 */
963function getBrowserCapabilitiesBitmap(win) {
964 let browserCapabilities = 0;
965 const doc = win.document;
966 if (win.SVGElement && doc.createElementNS) {
967 browserCapabilities |= Capability_Enum.SVG_SUPPORTED;
968 }
969 const iframeEl = doc.createElement('iframe');
970 if (iframeEl.sandbox && iframeEl.sandbox.supports) {
971 if (iframeEl.sandbox.supports('allow-top-navigation-by-user-activation')) {
972 browserCapabilities |=
973 Capability_Enum.SANDBOXING_ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION_SUPPORTED;
974 }
975 if (iframeEl.sandbox.supports('allow-popups-to-escape-sandbox')) {
976 browserCapabilities |=
977 Capability_Enum.SANDBOXING_ALLOW_POPUPS_TO_ESCAPE_SANDBOX_SUPPORTED;
978 }
979 }
980 return browserCapabilities;
981}
982
983/**
984 * Returns an enum value representing the AMP binary type, or null if this is a

Callers 1

googlePageParametersFunction · 0.70

Calls 1

supportsMethod · 0.80

Tested by

no test coverage detected