How to make fixed size window in privacy.resistfingerprinting (Firefox) - firefox

In Firefox, I use privacy.resistfingerprinting = true. How can I set the window size (1024x768 or 1366x768 or another) that I need? So that I open the browser and the window size matches the resolution I need.
What I did:
Set the values to privacy.window.maxInnerHeight and privacy.window.maxInnerWidth. But the size is 1000x700, 1400x800, etc., i.e. not the one i need.
Used privacy.resistfingerprinting.letterboxing with the specified resolution in .dimensions, it seems to work. BUT, this works with a delay. I open a test page in which resolution is displayed through <body onload="alert (window.innerWidth)"> and at the very beginning the real value is displayed and only then changed using letterboxing. That is, it is possible to intercept the real value.
I tried to resize the window through Window.resizeTo (), but it does not change.
Tell me how to launch a browser with a window of the desired size with privacy.resistfingerprinting enabled?

Related

Setting preferredContentSize of QLPreviewingController breaks auto resizing

Following the answer here:
Set QuickLook window size when previewing with QLPreviewingController.preparePreviewOfFile I set the preferredContentSize of the QLPreviewingController, which changes the window size as intended, but this seems to break subsequent auto resizing of all subviews. After setting it, the content will no longer track the preview window size when the user resizes it manually or enters fullscreen.
Any attempts to set view sizes, resizing masks or constraints programmatically after setting the preferredContentSize property will cause errors like
<NSViewServiceMarshal: 0x7fe1b740f170 <QLPreviewExtensionViewController: 0x600000e31b00 <NSServiceViewControllerWindow: 0x7fe1b760b350>>> attempted to set frame of <NSServiceViewControllerWindow: 0x7fe1b760b350> from {{17, 382}, {820, 846}} to {{17, 382}, {800, 600}} and got {{17, 136}, {820, 846}}; set breakpoint on -[NSViewServiceMarshal actualFrame:differsFromSpecifiedFrame:oldFrame:ofWindow:] to catch this
and have no visible effect. Setting the breakpoint only tells me that it happens in a system background thread at about the time I try to change the size of the view.
EDIT: Another finding: If I print the frames values of all views and the window to the log, the printed size is the one I requested, not the smaller one actually showing on the screen! I.e. if I set preferredContentSize to (820, 846), my debug NSLogs and the Xcode Debug View Hierarchy shows a window that is 820 x 846, while the actual window showing onscreen is twice as wide as it is high.
EDIT: Made a video to illustrate this problem: https://youtu.be/l7b1jq7pDWY
Original code is here:
https://github.com/angstsmurf/spatterlight/blob/quicklook-ifiction/iFictionQuickLook/iFictionPreviewController.m
This seems to be a Catalina only bug (earlier versions do not support this kind of Quicklook extension.) Upgrading to Big Sur made it go away.

Is it no longer possible to resize a Firefox window below a certain threshold width?

I'm using the latest Firefox testing a fluid layout.
Somehow after the last update of FireFox, I seem to no longer be able to shrink the page width below a certain threshold level (in my case 348px). Even if I delete all elements on the page, I'm still at 348px.
I have tried to hide all toolbars and Firefox buttons, but still no change.
If check a page in Chrome, the HTML width gets reported correctly = whatever my browser window is resized to.
*Question:
Is this a new "feature"/setting? If so, can I turn this off... It's annoying for sure.
Firefox 14 (if I remember correctly) should have a responsive layout tool - you might want to check that out.

Can a window be resized past the screen size/offscreen?

My purpose is to size a window to a width/height greater than the size of my physical screen programmatically under Win32. How can I do this?
On my systems it seems the maximum size of a given window is bound by the size of my screen whether programmatically or whether sizing manually by dragging the sizing cursor.
I have tried programmatically with SetWindowPos() and MoveWindow() and both cap the size of the target window. Oddly I know some people do not have this 'cap' so I wonder whether this is perhaps due to some OS setting (registry). Does anyone know something about this? Or perhaps some way to workaround it?
// Edit: new developments
I am testing on Windows XP and Windows 7. The graphics cards I'm using are a NVIDIA Quadro NVS 290 (256MB) and a Geforce 9800GT (1GB). After further investigation it looks like Windows is intercepting the message and fiddling with the parameters. For example, if you call SetWindowPos to make a target 2000x2000 it will only receive a WM_SIZE for the capped x/y.
Implement a message handler for WM_GETMINMAXINFO to stop Windows from applying the sane default behavior:
case WM_GETMINMAXINFO: {
DefWindowProc(hWnd, message, wParam, lParam);
MINMAXINFO* pmmi = (MINMAXINFO*)lParam;
pmmi->ptMaxTrackSize.x = 2000;
pmmi->ptMaxTrackSize.y = 2000;
return 0;
}
Windows with a thick frame (to allow user resize) are restricted from growing larger than the desktop.
Try SetWindowLong() clearing the THICKFRAME (0x40000) flag.
The following should allow programatic sizing, but the user will lose the ability to resize. If you add the Thickframe back after sizing, the user can resize, but when he does so the window will immediately shrink back to the desktop limited size.
The following is from some csharp code that also removes all borders, caption, etc:
WS style = (WS)GetWindowLong(ptr, GWL_STYLE);
style = style & ~WS.BORDER & ~WS.ThickFrame & ~WS.SYSMENU & ~WS.CAPTION | WS.POPUP;
SetWindowLong(ptr, GWL_STYLE, (int)style);
A good tool to play with window settings is uuSpy.
It's like Microsoft Spy++, but allows you to modify settings like THICKFRAME.
Yes, windows can be larger than the screen (or even the sum of all your monitors). Windows can also be positioned off-screen (which some applications do as a hack to hide while remaining active).
Perhaps the Windows 7 desktop manager is kicking in and trying to "dock" those windows to the edges of your screen for you.
You might try using the slightly lower-level API SetWindowPos, which gives you control over notifications, z-order, and other stuff.
You can get a window to be larger in resolution (and even way way larger) than your screen, using the 'Infinte Screen" software:
http://ynea.futureware.at/cgi-bin/infinite_screen.pl
Here's how to use it:
Download it, run it.
In the Oversize tab, choose the Windows you want to enlarge.
Give it the Width and Height you want. Done!
Just in case you need a large screenshot (that's how I ended up here):
If you want to get a screenshot of the window, you've got a screenshot option in the same Oversize tab. (Because screenshots are normally no bigger than the screen size, even if the window is larger). Another (and better) way to screenshot the window is using Greenshot, as you can save them in .tiff and directly watching the window.

Window disappears when resizing in Carbon Simulator

I'm trying to build a resizable Carbon window as part of a tutorial. I am using Interface Builder 3.2.3 on Snow Leopard 10.6.4.
If I create an empty Carbon project and add a window object from the Library (with Close, Minimize, Resize and Zoom buttons in the Inspector all checked), run the Carbon Simulator and then attempt to resize the window by grabbing the resize control, the window vanishes.
However if I create a Carbon project that already has the window object included (i.e instead of an empty project where I add the window myself after first creating it) I have no problem resizing the window in that case.
I try to visually match the selections in the Inspector to see what is different between the settings of these two cases but I don't readily notice any differences in the two sets of parameters that are displayed. Thus I am curious as whether there are more settings that just aren't displayed on the Inspector.
Are there any common reasons for a Carbon window to vanish upon resizing?
Thanks
I notice that if the option to receive clicks is not checked, then the window goes away when you try to resize it. But I don't know how you could uncheck that accidentally.
JWWalker, thanks for the response. Receive Clicks was checked on both versions.
But I think I was able to (sort of) figure out the discrepancy examining the .nib file.
Both files have two keys defined: maxSize (under com.apple.ibtool.document.localizable-all) and gMaxSize (under com.apple.ibtool.document.objects). In the working file both of these have a string setting of {480, 270}. In the nonworking file they had a string setting of {0, 0}. Apparently the default configuration of the working file was setting the maximum size of the window equal to zero. In Inspector the Window Template Size tab had the "Maximum Size" box checked but a "0" for both Width and Height. I clicked the box once to clear the check. Ran the Carbon Simulator again and the window resized properly without disappearing. When I rechecked the box, Inspector automatically filled in the Width and Height parameters with valid values of 480 and 270. I ran the Carbon Simulator again and it resized properly in accordance with the new maximum size constraint.
I don't fully understand the XML code in the .nib file but apparently the default setting for the maximum size of the window was being set to zero. The incorrect code appeared in the .nib file as follows (with non relevant lines deleted):
com.apple.ibtool.document.localizable-all
<dict>
<key>1</key>
<dict>
<key>maxSize</key>
<string>{0, 0}</string>
com.apple.ibtool.document.objects
<dict>
<key>1</key>
<dict>
<key>gMaxSize</key>
<string>{0, 0}</string>
You must uncheck the minimum size and maximum size in window template size or set the correct value.

TabCtrl_SetItemSize and user drawn tab controls

I have this Win32 user-drawn tab control that is created as:
CONTROL "Tab1",IDC_TAB_CONT,"SysTabControl32",TCS_BOTTOM |
TCS_OWNERDRAWFIXED | NOT WS_VISIBLE,0,14,185,88
I'd like for this control to have its tabs resize as never to have to see the "sliding arrows":
Now, pretty much everything about this control works as expected, except for that fact that it won't respond to TabCtrl_SetItemSize. Try as I may, the size I get for the tabs when I get to draw them (in the DRAWITEMSTRUCT passed to WM_DRAWITEM) is always the size that fits the longest caption in them and never the size I've set with TabCtrl_SetItemSize.
However, in the TabCtrl_SetItemSize documentation, it says that:
[TabCtrl_SetItemSize] sets the width and height of tabs in a
fixed-width or owner-drawn tab
control.
The only way I've managed to have a decent resizing is by setting a dummy string of the desired length in it by sending the control a TCM_SETITEM message, and writing the desired text in it at draw time. This is rather inconvenient and not a particularly nice hack.
Is there anybody who would know
Why TabCtrl_SetItemSize isn't working as expected? and/or
How to set the tab size properly?
Many thanks,
joce.
Setting TCS_OWNERDRAWFIXED style is not enough, you have also to add TCS_FIXEDWIDTH style.
The minimum size of a tab is at least icon width + 3 if icon is present.
If you have icons (imageList attached to tabControl), you might get those "sliding arrows" even with fixed width (if there is less space available than: number of tabs*(icon width+3)

Resources