Set zoom per host programmatically

633 views
Skip to first unread message

Theron

unread,
Apr 4, 2017, 1:37:51 AM4/4/17
to Chromium-discuss
I need a way to set the zoom level for a particular host programmatically (on Windows). I've found the relevant JSON key in the %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Preferences file. An example from my machine looks like:
"partition":{"per_host_zoom_levels":{"14695981039346656037":{"example.com":-1.5778829311823859}}}

My question: The first number in that sample (14695981039346656037) seems to be the same across machines, but I'm guessing it changes with Chrome versions, as other people online who have tried to do this give different numbers. And that "partition" key isn't present at all on a machine that hasn't had a custom zoom set yet. How can I detect or generate the correct number when applying this policy to new machines? Thanks to anyone who can help!

The information contained in this transmission may contain privileged and confidential information, including patient information protected by federal and state privacy laws. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

PhistucK

unread,
Apr 4, 2017, 1:46:18 AM4/4/17
to theron...@satchelhealth.com, Chromium-discuss
You should not fiddle with the Preferences file. It can change at any time.
The right way to do it is to use extensions, either an existing one, if you find something suitable, or to create one. There is a zoom API.


PhistucK

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+unsubscribe@chromium.org.

Theron Spiegl

unread,
Apr 4, 2017, 1:48:36 PM4/4/17
to PhistucK, Chromium-discuss
Could you please point me to the documentation on the zoom API you mentioned? I'm having trouble finding it. Thanks!

On Tue, Apr 4, 2017 at 12:45 AM, PhistucK <phis...@gmail.com> wrote:
You should not fiddle with the Preferences file. It can change at any time.
The right way to do it is to use extensions, either an existing one, if you find something suitable, or to create one. There is a zoom API.


PhistucK

On Tue, Apr 4, 2017 at 12:16 AM, Theron <theron.spiegl@satchelhealth.com> wrote:
I need a way to set the zoom level for a particular host programmatically (on Windows). I've found the relevant JSON key in the %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Preferences file. An example from my machine looks like:
"partition":{"per_host_zoom_levels":{"14695981039346656037":{"example.com":-1.5778829311823859}}}

My question: The first number in that sample (14695981039346656037) seems to be the same across machines, but I'm guessing it changes with Chrome versions, as other people online who have tried to do this give different numbers. And that "partition" key isn't present at all on a machine that hasn't had a custom zoom set yet. How can I detect or generate the correct number when applying this policy to new machines? Thanks to anyone who can help!

The information contained in this transmission may contain privileged and confidential information, including patient information protected by federal and state privacy laws. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+unsubscribe@chromium.org.

PhistucK

unread,
Apr 4, 2017, 3:49:53 PM4/4/17
to Theron Spiegl, Chromium-discuss
It has chrome.tabs.setZoom, getZoom, setZoomSettings and getZoomSettings.


PhistucK

Theron Spiegl

unread,
Apr 4, 2017, 5:42:12 PM4/4/17
to PhistucK, Chromium-discuss
Thank you, I appreciate it. Got an extension working already.

On Tue, Apr 4, 2017 at 2:48 PM, PhistucK <phis...@gmail.com> wrote:
It has chrome.tabs.setZoom, getZoom, setZoomSettings and getZoomSettings.


PhistucK
Reply all
Reply to author
Forward
0 new messages