/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
CSSIntRect nsScreen::GetRect() { // Return window inner rect to prevent fingerprinting. if (ShouldResistFingerprinting(RFPTarget::ScreenRect)) { return GetTopWindowInnerRectForRFP();
}
// Here we manipulate the value of aRect to represent the screen size, // if in RDM. if (nsPIDOMWindowInner* owner = GetOwnerWindow()) { if (Document* doc = owner->GetExtantDoc()) {
Maybe<CSSIntSize> deviceSize =
nsGlobalWindowOuter::GetRDMDeviceSize(*doc); if (deviceSize.isSome()) { const CSSIntSize& size = deviceSize.value(); return {0, 0, size.width, size.height};
}
}
}
CSSIntRect nsScreen::GetAvailRect() { // Return window inner rect to prevent fingerprinting. if (ShouldResistFingerprinting(RFPTarget::ScreenAvailRect)) { return GetTopWindowInnerRectForRFP();
}
// Here we manipulate the value of aRect to represent the screen size, // if in RDM. if (nsPIDOMWindowInner* owner = GetOwnerWindow()) { if (Document* doc = owner->GetExtantDoc()) {
Maybe<CSSIntSize> deviceSize =
nsGlobalWindowOuter::GetRDMDeviceSize(*doc); if (deviceSize.isSome()) { const CSSIntSize& size = deviceSize.value(); return {0, 0, size.width, size.height};
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.