Disable cleartype - cleartype

I have code that takes a screenshot and applies very basic OCR (pixel matches characters). Been testing on virtualbox machine and it was working fine. And when I ran it on Windows 7 the code no longer works due to Cleartype. Is it possible to disable Cleartype for certain windows?

Here is the win32 function you'd use to do it, but im not sure you can do it for a single window..

Related

JxBrowser | Content not rendering

I am experiencing an issue related to the displaying of any content within the JxBrowser, but only for 1 specific client PC.
The JxBrowser seems to correctly process the content that is sort of present, because if I click on an area where I know there is a link, the new page is opened (but not rendered too).
The "pages are not displayed" means that the content is completely white. Furthemore, the pointer is repetitively blinking between the normal arrow icon and the waiting circle, as something is going on in the background every about 1 sec.
A previous version of the application that embeds the JxBrowser doesn't produce the same problem.
Later on, I have also upgraded the JxBrowser version from the 6.23 to 6.24.3, but this did not solve.
Deleting any caches produced by the presence of the JxBrowser on the PC did not solve either.
What should I investigate to try and address this situation?
First of all, please note that JxBrowser 6 is no longer supported and it's a very old version based on Chromium 69. A lot of popular websites might not work properly in this Chromium version.
If the issue is reproducible only in a specific environment, then it's probably an environment-specific issue. If we are talking about rendering, then usually Chromium cannot render content when there's an issue with GPU drivers and the rendering mode (heavyweight or lightweight).
From our practice, disabling GPU very often helps in such cases. Please try passing the --disable-gpu switch and see if it helps. If it doesn't help, then the issue is probably in something else and additional research or even access to this environment is required. But again JxBrowser 6 is no longer supported.
As an option you can try JxBrowser 7 and see if it helps, but it's not that easy because this version has a new API which is not backward-compatible with the previous version.

How-to render pages like Safari on OS X, while on Windows

For some time now I have been struggling with the differences between the Mac and Windows version of Safari. Sadly, my develop-setup requires me to work on Windows (although I do work on a MBP), so I can't change stuff and look how it affects the rendering of the page. Updating the online testing environment every time I make a change is silly.
The solution renders fine in Chrome (Windows+Mac), Firefox (Windows+Mac) and.. Even Internet Explorer.
So, my question is: is there a way to make Safari on Windows behave as if it were on OS X?
Thanks in advance :)
You could install a virtual machine running OSX:
http://www.macbreaker.com/2014/05/os-x-mavericks-in-virtualbox-with-niresh.html
I'm not sure how else you would be able to do it through windows.

Max memory usage of a chrome process (tab) & how do I increase it?

I am running several thousand https clients through chrome on one tab, I seem to be hitting a limit in the browser, when I check task manager the chrome process for that tab is using a whopping 897MB so I am assuming there is some sort of limit (900MB~).
Are there any chrome wizards around that could explain this? Also it would be ideal if I could increase the max limit so I am able to run more clients through a single tab.
By default v8 has a memory limit of 512MB on 32-bit systems, and 1.4GB on 64-bit systems. The limit can be raised by setting --max_old_space_size to a maximum of 1024 (1 GB) on 32-bit and 4096 (4GB) on 64-bit. You should be able to set this parameter when launching Chrome from a shell in Linux, or as an argument to the shortcut path in Windows.
Aggregated answer based on Mihai Tomescu's answer and other resources:
Maximum memory per tab seems to be about 1.8GB when running a x64 Windows OS, according to this answer
Increasing tab memory works fine by changing Chrome link address from "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" to "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --max_old_space_size=4096
The difference can be quickly tested using this huge image which will crash Chrome using default memory settings (Google Chrome ran out of memory while trying to display this webpage), but will render fine after increasing the memory limit.
It seems --max_old_space_size does not work anymore.
I tested on Ubuntu 22.04 (Version 106.0.5249.119) where it did nothing, and I found this thread on Google Support saying it was removed in Chrome 104.
I don't believe electron has a hard limit of 4gb. That may be its
default, but I've been able to get to 16gb by doing the following in
main.js:
const { app } = require('electron');
app.commandLine.appendSwitch('js-flags', '--max-old-space-size=16384');
Unfortunately no such switch exists for the Chrome browser.
Reference:
Issue 1081316: It is time to remove the 4G/tab limitation

watir-webdriver black screenshots

I'm using watir-webdriver to navigate around my website and grab screenshots in different browsers.
Sometimes the screenshots taken in IE turn out the right size, but colored entirely black. The firefox tests that get run at the same time look fine.
browser.driver.save_screenshot(screenshot_dir)
Once I remote desktop to the computer running the tests the IE screenshots look okay again. A little bit after leaving remote desktop the IE screenshots go black again.
I'm running these tests on a instance of Windows Server running on ec2.
Based on your comment that remotely accessing the machine resolves the problem for a little while... disable the screensaver on that box. I'm not sure how (if at all) the screenshot functions on IE and FF differ, but it's worth the time it would take to test the change.
Edit: I still feel like it's windows/power setting related as you logging into the box appears to have an effect, but I don't know what else specifically that could be. I tried a programmatic approach below vvv.
From what you are saying, it sounds like the Windows system is automatically locking, like it should. This would explain why screenshots work fine when you remote in, and then go to black several minutes later when the screensaver kicks in and locks your system.
If the Windows system is locked, screenshots are blacked out. This is a Windows security feature.
I would be curious to know if FF really does do screen captures on a locked system.
Here's the code I'm using to capture screenshots (Watir-Webdriver, Cucumber). I use remote Windows XP VMs for my test boxes, and have not encountered the issue using Firefox or Internet Explorer.
We did find that when you view the log with the embedded screenshot, it does not seem to work in IE - so you have to use Firefox for viewing. It's base64, so there doesn't seem to be a logical reason for this.
After do |scenario|
if scenario.failed?
encoded_img = #browser.driver.screenshot_as(:base64)
embed("data:image/png;base64,#{encoded_img}", 'image/png')
end #
end

What IE version should you install to check CSS compatibility on IE with a Mac?

I'm trying to fix my css on IE, and I want to check to see if it's working. What version should I install and from where?
Different versions of IE behave differently. If you care about all versions, you'll have to install them all.
IE doesn't run natively on a Mac. You'll either need to use a virtualization program like VirtualBox (which itself is free, but you still need a copy of Windows) to produce a virtual Windows environment, or use services like BrowserShots that will produce images taken in IE for you (but they're often very busy and therefore slow).
IE8, because it's stable and has IE7 compatible view mode.
It doesn't run on Mac OS, you will need to run it in Virtual Machine (VMWare, Virtualbox or Parallels).
Best way is to use a VM, as #Matchu told in his answer.
But if you can't, this is pretty good one:
https://browserlab.adobe.com/en-us/index.html

Resources