How to shrink/zoom/scroll the browser display?

Discussions and Tech Support related to using the iMacros Component for .NET in your applications.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
BGood
Posts: 19
Joined: Thu Mar 31, 2011 2:23 am

How to shrink/zoom/scroll the browser display?

Post by BGood » Wed Mar 20, 2013 6:07 pm

Is there a way to programatically shrink/zoom/scroll the browser display? By this I mean:

Shrinking would scale the font size down and show more of the web page.

Zooming would show less of the web page and effectively scale the font size up.

Scrolling would move the display window up/down the page.

Right now, the only way I have figured out to scroll is to target an html element, and I have not figured out a way to do shrinking/zooming yet.

Thanks.
Marcia, Tech Support

Re: How to shrink/zoom/scroll the browser display?

Post by Marcia, Tech Support » Fri Apr 05, 2013 7:24 am

Hi,

I am afraid you cannot do this in the iMacros Component's browser...
rguez_18
Posts: 102
Joined: Thu Oct 20, 2005 6:04 pm
Contact:

Re: How to shrink/zoom/scroll the browser display?

Post by rguez_18 » Tue May 14, 2013 1:57 pm

You can scroll by using the script below. You can play around with the parameters to hit the location on where you want to scroll to. Hope this helps. Thanks!

URL GOTO=javascript:window.scrollBy(0,150)
.NET Developer
<---Using IMacro since version 4 - See Date Joined on Forum
***For Quotes and Estimates please feel free to contact me.
YM: Rguez_18 <at> y a hoo <that> com
Skype: Rguez_18
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to shrink/zoom/scroll the browser display?

Post by chivracq » Mon Feb 24, 2014 1:37 pm

Reading sometimes some older Threads (for fun!!)...

For Scrolling, I use indeed as well the same Code like 'rguez_18' in my Scripts.

I don't do any Zooming nor Shrinking but some quick Testing gives me a way to achieve it using the EVENT Mode on Firefox with the following Code:

Code: Select all

VERSION BUILD=8810214 RECORDER=FX
TAB T=1
URL GOTO=http://forum.imacros.net/viewtopic.php?f=24&t=20499

'EVENT TYPE=CLICK SELECTOR="#p51935>DIV>DIV>DIV>SPAN:nth-of-type(2)" BUTTON=0
'EVENT TYPE=CLICK SELECTOR="#p52778>DIV>DIV>DIV" BUTTON=0
TAG POS=1 TYPE=SPAN ATTR=TXT:Zooming
EVENT TYPE=KEYPRESS SELECTOR="#phpbb" CHAR="+" MODIFIERS="ctrl"
WAIT SECONDS=2
EVENTS TYPE=KEYPRESS SELECTOR="#phpbb" CHARS="++++++++" MODIFIERS="ctrl"
WAIT SECONDS=2
'EVENT TYPE=CLICK SELECTOR="#p51935>DIV>DIV>DIV>SPAN" BUTTON=0
WAIT SECONDS=2
EVENT TYPE=KEYPRESS SELECTOR="#phpbb" CHAR="-" MODIFIERS="ctrl"
WAIT SECONDS=2
EVENTS TYPE=KEYPRESS SELECTOR="#phpbb" CHARS="----" MODIFIERS="ctrl"
WAIT SECONDS=2
EVENTS TYPE=KEYPRESS SELECTOR="#phpbb" CHARS="----" MODIFIERS="ctrl"
The TAG is not even needed, but can be used to direct the Zooming at a specific Element/Area...

I can use "====" instead of "++++" as well for Zooming, as I have the "+" and "=" Chars on the same Key on my Keyboard.

Tested on iMacros v8.8.1 Add-on for Firefox on Pale Moon v24.3.2 (= FF v27.0.1) on WinXP SP3.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
MWK
Posts: 1
Joined: Mon Aug 10, 2015 3:44 am

Re: How to shrink/zoom/scroll the browser display?

Post by MWK » Mon Aug 10, 2015 3:49 am

Hi
iam stuck on the same issue

using iMacros Component's browser.

anyway round this problem


want to zoom and shrink page for different testing environments
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to shrink/zoom/scroll the browser display?

Post by chivracq » Mon Aug 10, 2015 8:03 pm

MWK wrote:Hi
iam stuck on the same issue

using iMacros Component's browser.

anyway round this problem

want to zoom and shrink page for different testing environments
FCIM...! :mrgreen:

I already gave a working Solution for FF, that can be your Plan B...

Your "different testing environments" sounds completely vague to me...

If you can find a way to do the Zooming in JavaScript, you should be able I reckon to use the 'URL GOTO' Syntax like for Scrolling...

A quick Search in Google (most Hits from Stackoverflow, for example this one and this one...) retrieves a few different ways to do it, but for the 4 following ones, none is supposed to work in FF, and indeed, I don't get any to work [on iMacros for FF v8.8.2, Pale Moon v24.6.2 (=FF31), Win7-x64]. They are supposed to work on IE and CR, I'll let you test them and report...:

Code: Select all

'URL GOTO=javascript:window.parent.document.body.style.zoom=2
'URL GOTO=javascript:window.parent.document.body.zoom=2
'URL GOTO=javascript:document.body.style.zoom="80%"
URL GOTO=javascript:document.body.style.zoom=1.0;this.blur()
(You try them one by one...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply