Skip to content

Change screen resoultion #70

@ssgnilsen

Description

@ssgnilsen

screen.cc at the GetScreenInfo() function inside /third_party/blink/renderer/core/frame/screen.cc b/third_party/blink/renderer/core/frame/screen.cc:

const display::ScreenInfo& Screen::GetScreenInfo() const {
  DCHECK(DomWindow());
  LocalFrame* frame = DomWindow()->GetFrame();

  const auto& screen_infos = frame->GetChromeClient().GetScreenInfos(*frame);
  const display::ScreenInfo* result = nullptr;
  DEFINE_STATIC_LOCAL(display::ScreenInfo, kEmptyScreenInfo, ());

  for (const auto& screen : screen_infos.screen_infos) {
    if (screen.display_id == display_id_)
      result = &screen;
  }

  if (!result)
    result = &kEmptyScreenInfo;

  const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
  if (command_line->HasSwitch("fingerprint-screen-width") ||
      command_line->HasSwitch("fingerprint-screen-height") ||
      command_line->HasSwitch("fingerprint-device-scale-factor")) {

    spoofed_screen_info_ = *result;

    int width;
    if (base::StringToInt(command_line->GetSwitchValueASCII("fingerprint-screen-width"), &width) && width > 0) {
      spoofed_screen_info_.rect.set_width(width);
      spoofed_screen_info_.available_rect.set_width(width);
    }

    int height;
    if (base::StringToInt(command_line->GetSwitchValueASCII("fingerprint-screen-height"), &height) && height > 0) {
      spoofed_screen_info_.rect.set_height(height);
      spoofed_screen_info_.available_rect.set_height(height);
    }

    double scale;
    if (base::StringToDouble(command_line->GetSwitchValueASCII("fingerprint-device-scale-factor"), &scale) && scale > 0) {
      spoofed_screen_info_.device_scale_factor = static_cast<float>(scale);
    }

    return spoofed_screen_info_;
  }

  return *result;
}

Trying to update the KGMK@DESKTOP-GO49NL0 MINGW64 ~/Desktop/fingerprint-chromium/patches/extra/fingerprint ((139.0.7258.154))

$ patch -p1 --ignore-whitespace -i 019-screen.patch
can't find file to patch at input line 9
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|---
| third_party/blink/renderer/core/frame/screen.cc | 35 +++++++++++++++++++++++++++++++
| 1 file changed, 35 insertions(+)
|
|diff --git a/third_party/blink/renderer/core/frame/screen.cc b/third_party/blink/renderer/core/frame/screen.cc
|index 4d7c1d8a4e..f1234567 100644
|--- a/third_party/blink/renderer/core/frame/screen.cc
|+++ b/third_party/blink/renderer/core/frame/screen.cc
--------------------------
File to patch: C:\Users\KGMK\Desktop\fingerprint-chromium\build\src\chromium-139.0.7258.154\third_party\blink\renderer\core\frame\screen.cc
C:\Users\KGMK\Desktop\fingerprint-chromium\build\src\chromium-139.0.7258.154\third_party\blink\renderer\core\frame\screen.cc: No such file or directory
Skip this patch? [y] n
File to patch: C:\Users\KGMK\Desktop\fingerprint-chromium\build\src\chromium-139.0.7258.154\third_party\blink\renderer\core\frame\screen.cc
patching file 'C:\Users\KGMK\Desktop\fingerprint-chromium\build\src\chromium-139.0.7258.154\third_party\blink\renderer\core\frame\screen.cc'
patch: **** unexpected end of file in patch

KGMK@DESKTOP-GO49NL0 MINGW64 ~/Desktop/fingerprint-chromium/patches/extra/fingerprint ((139.0.7258.154))
$

But huge problem!! patch: **** unexpected end of file in patch

I will update if I am able to fix it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions