Generated file

Copy as Markdown

Other Tools

/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. */
if (navigator.mediaDevices?.getDisplayMedia) {
const maybeDeleteResizeMode = video => {
const { resizeMode, width, height, frameRate } = video;
if (resizeMode == "none" && (width || height || frameRate)) {
delete video.resizeMode;
}
};
{
const { prototype } = MediaDevices;
const { getDisplayMedia: gDM } = prototype;
prototype.getDisplayMedia = function getDisplayMedia(options) {
const { video } = options || {};
if (video) {
maybeDeleteResizeMode(video);
}
return gDM.call(this, options);
};
}
{
const { prototype } = MediaStreamTrack;
const { applyConstraints: aC } = prototype;
prototype.applyConstraints = function applyConstraints(constraints) {
// Don't allow adding resizeMode if it wasn't there from the start.
// Ideally we'd check for a gDM-sourced track instead but there's no
// spec-compliant way to do that.
if (!this.getConstraints().resizeMode) {
maybeDeleteResizeMode(constraints || {});
}
return aC.call(this, constraints);
};
}
window.__webcompat = (window.__webcompat ?? new Set()).add(
"getDisplayMedia resizeMode"
);
}
{
const bugInfo = [["teams.microsoft.com", ["2000906"]], ["teams.live.com", ["2000906"]]];
const msgs = window.__webcompat;
delete window.__webcompat;
if (msgs?.size) {
const bugs =
bugInfo.find(([domain]) => location.href.includes(domain))?.[1] ??
bugInfo[0][1];
const bugNumbers = bugs.map(b => "https://bugzil.la/" + b).join(" and ");
console.info(
`${[...msgs].join(", ")} ${msgs.size > 1 ? "are" : "is"} being altered for compatibility reasons. See ${bugNumbers} for details.`
);
}
}