Jump to content
Macro Express Forums

Firefox 4: new 'loading' icon


Recommended Posts

I just installed FF version 4. Amongst other changes I see that the red X icon top left that I've been using for pixel testing in my macro 'Wait for FF ready' has now been replaced. Unless anyone has already done so and is happy to share, I'll have to re-write it. Looks like a spinning wheel now, so a bit more complex.

 

FF-Wait.jpg

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I just installed FF version 4. Amongst other changes I see that the red X icon top left that I've been using for pixel testing in my macro 'Wait for FF ready' has now been replaced. Unless anyone has already done so and is happy to share, I'll have to re-write it. Looks like a spinning wheel now, so a bit more complex.

 

FF-Wait.jpg

 

--

Terry, East Grinstead, UK

Terry

 

Have you investigated the various add-ins for that "feature"?

 

I haven't looked myself, but in earlier versions of Firefox I used an add-in that combined the "loading/stop" indicator.

 

For example, this one Smart Stop/Reload does magical stuff that might make it easier for you.

 

There are various other toys there that might deliver the goods.

Link to comment
Share on other sites

Don't bother about the spinning wheel (actually, perhaps because I'm using Tab Mix Plus, the spinning icon appears on the tab, and not where the X is). If your spinning wheel is where the X should be, then I don't think any of what follows will be of use to you.

 

I have done as follows to make it all work as before:

1) Made my Stop Loading button (the X that used to be red) limited to that functionality, and removed the dual Reload capability - if you want to know how to do that, let me know: it's essential for the next step

2) Checked the colour at 75,70, which is directly below the X, one pixel to the right of centre. For my video card, this is 13817560 or 13751511 while the page is loading, and 13686231 or 13620182 when finished. But beware! Between Still loading and Finished loading there appears to be another set of colours that appears for a moment, in my case 13620695 or 13620438. So I treat these latter 2 colours (temporary unknown status) the same as the 1st 2 colours (still loading), only exiting my loop either when I discern either of the middle 2 colours (loaded), or when it all times out after my specified maximum wait time.

 

Why am I providing 2 sets of colours, you may ask? Well, I started this exercise and identified the first of each set of 2 colours. I then experimented with adding the reload capability, found that this killed the above logic, disabled it, and found a new set of colours! Go figure!

Link to comment
Share on other sites

Thanks both, I'll investigate those suggestions when I get back to my PC. However, I'm not sure I follow your approach Paul? The red X no longer exists here. I was therefore assuming it was now a matter of testing to see when the wheel stopped spinning.

 

I also use TMP.

 

--

Terry, UK

Link to comment
Share on other sites

However, I'm not sure I follow your approach Paul? The red X no longer exists here. I was therefore assuming it was now a matter of testing to see when the wheel stopped spinning.

 

I also use TMP.

I don't have a red X either. But, instead, I have a greyed out X when the page has loaded, and an ungreyed out X while it is loading. (And, instead of the greyed out X, you can opt for the reload icon once the page is loaded if you choose to combine the two icons, or you can restore the 2 separate icons as per FF3.n versions.) As I said, I get the spinning wheel only within each tab, to the left of the name, and which is replaced by the site icon once finished loading.

Link to comment
Share on other sites

I have not yet installed Firefox 4, but here is something that I experimented with in Firefox 3. The script infers (since we can't detect directly) when a page is fully loaded. It "looks" for the word "Done" to appear on the status line at a particular place. The word is always black, e.g., colour = 0. The macro is supposed to find that spot.

 

This macro is not fully worked out, but I hope that my code will help someone else to make it functional. (My guess is that it will prove necessary to test one or more additional black pixels that are close to the one this script finds.)

 

The strategy is to map out the Firefox UI by using a combination of programmatic information -- the main Firefox window is one big control that MEP can detect -- and pixel colour searches. The script gets the height of the control, which is how the script figures out the position of the bottom of the status line. Then we find the top of the status line by hunting for its top border: check upwards until the pixel changes to "13160660." Then reposition the cursor to the horizontal centreline of the status line, and hunt right for the colour black.

 

I have a different (but related script) that hunts for colour changes in the address line, and it is surprisingly reliable. (I have tested it on several PCs, and it works everywhere... so far!) It would be nice if there was a clear, unambiguous way for Macro Express to determine when a Firefox page is fully loaded... but at least it's possible to do somersaults to get the same result...

 

// Use "Capture Window Control" to capture the main Firefox window. Specify a partial match = "- Mozilla Firefox"
Get Control: (FIREFOX.EXE) Using z-order -> %MainFFControl%

// Get the height of the main FF control
Variable Set Integer %Height%: Set to a Control's Height (%MainFFControl%)

// Move to bottom left corner, which should be the bottom of the status line
Mouse Move: 0, %Height% Relative to Control: %MainFFControl%
Variable Set Integer %StatusLineBottom%: Set to the Mouse Y Coordinate

// Hunt upward for the top of the status line
Repeat Until %Pixel% Equals "13160660"
 Mouse Move: 0, -1 Relative to Last Position
 Get Pixel Color from Beneath the Mouse into %Pixel%
End Repeat

// Calculate height of status line, and then half way point...
Variable Set Integer %StatusLineTop%: Set to the Mouse Y Coordinate
Variable Modify Integer: %StatusLineHeight% = %StatusLineBottom% - %StatusLineTop%
Variable Modify Integer: %StatusLineHalfHeight% = %StatusLineHeight% / 2

// Move cursor down to centreline of status bar
Mouse Move: 0, %StatusLineHalfHeight% Relative to Last Position

// Hunt right for black - the status line appears to always contain some black text!
Repeat Until %Pixel% Equals "0"
 Mouse Move: 1, 0 Relative to Last Position
 Get Pixel Color from Beneath the Mouse into %Pixel%
End Repeat

Link to comment
Share on other sites

I have not yet installed Firefox 4, but here is something that I experimented with in Firefox 3. The script infers (since we can't detect directly) when a page is fully loaded. It "looks" for the word "Done" to appear on the status line at a particular place. The word is always black, e.g., colour = 0. The macro is supposed to find that spot.

I gave up on this approach because the word "Done" did not always appear in FF 3; I found numerous examples of nothing appearing (instead of Done), or the previous status being wrongly retained. Perhaps FF4 is better in this respect - I'll pay some attention to this now.

Link to comment
Share on other sites

I don't have a red X either. But, instead, I have a greyed out X when the page has loaded, and an ungreyed out X while it is loading. (And, instead of the greyed out X, you can opt for the reload icon once the page is loaded if you choose to combine the two icons, or you can restore the 2 separate icons as per FF3.n versions.) As I said, I get the spinning wheel only within each tab, to the left of the name, and which is replaced by the site icon once finished loading.

 

Can you tell me how to get that changing X please? I can't find how to set that. Here's a full screenshot of my current setup.

 

FF4-Tools.jpg

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I have not yet installed Firefox 4, but here is something that I experimented with in Firefox 3. The script infers (since we can't detect directly) when a page is fully loaded. It "looks" for the word "Done" to appear on the status line at a particular place.

 

Alan:

 

As far as I can tell, 'Done' no longer appears in FF4. In fact there seems to be no Status Bar, just an (optional) 'Add-on' Bar. Please correct me if I'm wrong; maybe there's an option I haven't found yet. If it does still appear, that could well be the way that I'll test for a finished page load. As per my other post, in reply to Paul, I've still not found an easy way to do it.

 

BTW, did you consider maximising FF (or its height, at least during this macro), so that you could refer to a fixed pixel position, thus avoiding your 'hunting' code?

 

My previous macro was very simple but reliable:

 

Delay: 500 milliseconds

Repeat Until %StopColour% Equals "10264995" // Theme: Default

Get Pixel Color at (110, 64) Relative to Current Window into %StopColour%

Delay: 50 milliseconds

End Repeat

 

P.S. Anyone have a macro that will convert a pixel number (like 10264995 above) to an RGB trio or hex code, or even better, display a nice large swatch of that colour?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

As far as I can tell, 'Done' no longer appears in FF4. In fact there seems to be no Status Bar, just an (optional) 'Add-on' Bar. Please correct me if I'm wrong; maybe there's an option I haven't found yet.

You need this addon - Restore FF Status Bar (this was easily found by googling "firefox 4 status bar"!)

 

Can you tell me how to get that changing X please? I can't find how to set that. Here's a full screenshot of my current setup.

The 1st point in my 1st post touches on this implicitly. Here's what you need to do:

- View / Toolbars / Customize

- I'm pretty sure you'll see TWO buttons where your first arrow points to in your screenshot, namely the Reload and Stop Loading buttons. You can do 1 of 2 things: remove the reload button completely by dragging it back to the Customize Icons window (you don't really need it as F5 does the same thing), or place it immediately to the right of the Stop Loading button, in which case you'll then have the 2 buttons you used to have in FF3. Whichever choice you make, you'll have the same grey X as me. And now you'll almost certainly experience one of the many FF 4 bugs, in that once you've stopped customizing, you'll have to shut FF down using Task Manager, as the menu choices will have become greyed out (assuming you're displaying the menu bar).

 

I strongly recommend you do some research into FF 4 - none of the above was hard to discover.

Link to comment
Share on other sites

Thanks.

 

Firefox > Options > Toolbar layout displays the Customize window in my case. (As I showed earlier, I have the Firefox button in the top row and no Menu bar.) It looks like this and doesn't offer any Reload or Stop Loading button.

 

FF-CustomizeDialog.jpg

 

I expect these are restored after installing that extension you recommend thanks. But after further research and help in the FF forum I've accomplished my aim very simply by adding the following code to userchrome.css

 

/* To make the spinner's background turn red if the currently selected tab is loading (busy) */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

 

#navigator-throbber[busy] {

background: #f00 !important;

 

 

I was then able to restore normal operation by making a trivial change to my old macro.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Firefox > Options > Toolbar layout displays the Customize window in my case. (As I showed earlier, I have the Firefox button in the top row and no Menu bar.) It looks like this and doesn't offer any Reload or Stop Loading button.

Well, of course it doesn't! That's because those 2 buttons are already in use, as I described in my latest text! As previously stated, you need to drag the reloading button, which is already on the relevant toolbar, either back to the Customize window, or immediately to the right of the Stop Loading button (actually, that can't be right; you simply need to drag it away from its current position which is immediately to the left of the Stop Loading button). And what a truly horrible non-standard design that is, to have 2 buttons subsumed into one when they happen to be adjacent and in a particular sequence..

Link to comment
Share on other sites

Well, of course it doesn't! That's because those 2 buttons are already in use, as I described in my latest text! As previously stated, you need to drag the reloading button, which is already on the relevant toolbar, either back to the Customize window, or immediately to the right of the Stop Loading button (actually, that can't be right; you simply need to drag it away from its current position which is immediately to the left of the Stop Loading button). And what a truly horrible non-standard design that is, to have 2 buttons subsumed into one when they happen to be adjacent and in a particular sequence..

 

Not that it really matters now that I've solved the problem, but I'm still unclear what the Stop Loading button is that you keep referring to. Do you mean the spinner icon? After View / Toolbars / Customize, when you said "I'm pretty sure you'll see TWO buttons where your first arrow points to in your screenshot, namely the Reload and Stop Loading buttons." I don't see those adjacent.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I expect these are restored after installing that extension you recommend thanks. But after further research and help in the FF forum I've accomplished my aim very simply by adding the following code to userchrome.css

As a matter of interest, where is this file located in Firefox 4? I've read about 2 different locations, and, in any case, neither appeared to work for me.

Link to comment
Share on other sites

I'd be most interested in seeing one or more screenshots of your toolbars in customize mode!

 

Not sure what this adds to the screenshots I've shown you before, but here's what you're asking for:

 

FF-ToolbarsCustomize.jpg

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

As a matter of interest, where is this file located in Firefox 4? I've read about 2 different locations, and, in any case, neither appeared to work for me.

 

Same location as FF 3. In my case it's at

C:\Documents and Settings\Terry\Application Data\Mozilla\Firefox\Profiles\hj8vo785.default\chrome\userChrome.css

 

Did you close FF4 before editing it with the new code?

 

Maybe your TMP settings or some other existing special CSS in the file is conflicting? Although it remains unclear to me just what your toolbars look like (as you've shown no screenshot), it sounds like your TMP configuration is significantly different to mine.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Not that it really matters now that I've solved the problem, but I'm still unclear what the Stop Loading button is that you keep referring to. Do you mean the spinner icon? After View / Toolbars / Customize, when you said "I'm pretty sure you'll see TWO buttons where your first arrow points to in your screenshot, namely the Reload and Stop Loading buttons." I don't see those adjacent.

 

--

Terry, East Grinstead, UK

 

BTW, you haven't answered my question.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

BTW, you haven't answered my question.

Sorry, please can you repeat it?

 

From your latest screenshot I now see you haven't got the Stop button anywhere on any toolbar. So it must be in your customize window - did you try scrolling down to the bottom (on my machine the Stop button, when not located on a toolbar, is the last button in the customize window).

 

Yes, I always close FF before editing any user files.

 

And I now see I wasn't addressing the userchrome.css file, but rather the usercontent.css file.

 

And here are my screenshots for your enjoyment!

 

post-10-0-79462400-1301274048_thumb.png

 

post-10-0-31401500-1301274065_thumb.png

Link to comment
Share on other sites

Sorry, please can you repeat it?

 

It was "I'm still unclear what the Stop Loading button is that you keep referring to. Do you mean the spinner icon?"

 

From your latest screenshot I now see you haven't got the Stop button anywhere on any toolbar.

Its absence was clear in my earlier full toolbar screenshot (post #8). My last screenshot merely added the Customise toolbar window.

 

So it must be in your customize window - did you try scrolling down to the bottom (on my machine the Stop button, when not located on a toolbar, is the last button in the customize window).

 

No, it's not. As I said several times up-thread, I don't have such a button or icon offered in that window. Here's a 'composite' showing its full contents:

 

FF-CustomizeDialogFull.jpg

 

I see it in your screenshot. So it's puzzling that I don't have it. It no doubt has some cause that will be obvious once we find it, and I expect it will be something I've set somewhere that doesn't immediately spring to mind. But not quite so obviously down to my ignorance/laziness, which is the impression I gained of your assumption!

 

If I hadn't already sorted the practical problem that prompted this thread I'd use Restore Default Set, as I dislike unsolved puzzles. But that would mean investigating/restoring previous customising, so I'll leave it there.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...