ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Firefox Extension Coding - Stop Those Livemarks

(1/1)

Ehtyar:
Hi all.
I've just upgraded to Firefox 3, and as one might expect I'm pretty wrapped. The transition from 2 to 3 however (I use the portable version and thus had to manually reload Firefox), something came to my attention that i was not aware of prior to the transition. I have quite a few 'livemarks' (firefox rss subscriptions) and I've noticed how often they actually update. I'll be lucky if i get around to checking my feeds once a week, though apparently they update every 15 minutes. Unfortunately Firefox provides no mechanism to prevent this process from ocurring. You can lengthen/shorten the delay between updates via the hidden preference 'browser.bookmarks.livemark_refresh_seconds', but it cannot be disable entirely. I've found Reliby which I can use to manually update the feeds when I'd like to peruse them.
I believe i have found the location where this process is initiated: line 917 in browser.js
--- ---  setTimeout(function() PlacesUtils.livemarks.start(), 5000);
for those familiar with Firefox's guts, though I've been unable to find the location of this function (it does not appear to be in utils.js as one might expect). Unfortunately, were i to simply delete this line, i would be forced to continue doing so each time the browser was updated. I am hoping someone here is familiar enough with Firefox's inner workings to perhaps attempt creation of an addon to prevent the automatic feed updating process. I have read a handful of documents on the subject, prior to which i considered myself a coder, but now i'm not so certain  :'(.
Anyway, if anyone were able to get me any closer to accomplishing my goal, i would very much appreciate it.

Thanks, Ehtyar.

Lashiec:
Did you try setting it up to 0, -1 or an obscenely high number?

Ehtyar:
Did you try setting it up to "-1" or an obscenely high number?
-Lashiec (June 19, 2008, 05:46 PM)
--- End quote ---
Hey lash man :) Unfortunately that won't stop the initial update when the browser is first started, and I've read on the mozilla forum (can't find the link for the life of me) that neither approach works; apparently setting the number to an invalid value (-1, 0 etc) or setting it too high (>6 hours if memory serves) causes Firefox to use the default value (15 minutes). Thanks for the suggestion though.

Ehtyar.

yotta:
why does it bother you that it updates?

Ehtyar:
why does it bother you that it updates?
-yotta (June 20, 2008, 10:21 AM)
--- End quote ---
Just because it's so excessive really. I have about 20 feeds, and look at them once a week, yet they're being updated on average about every two hours (I've been testing with Live HTTP Headers). I've been making some progress on my own, however. The code shown above:
--- ---setTimeout(function() PlacesUtils.livemarks.start(), 5000); executes the function LS_start() found in components\nsLivemarkService.js:
--- ---  --Line 509--
  _updateTimer: null,
  start: function LS_start() {
    if (this._updateTimer)
      return;
    // start is called in delayed startup, 5s after browser startup
    // we do a first check of the livemarks here, next checks will be on timer
    // browser start => 5s => this.start() => check => refresh_time => check
    this._checkAllLivemarks();
    // the refresh time is calculated from the expiration time, but with a cap
    var refresh_time = Math.min(Math.floor(gExpiration / 4), MAX_REFRESH_TIME);
    this._updateTimer = new G_Alarm(BindToObject(this._checkAllLivemarks, this),
                                    refresh_time, true /* repeat */);
  },
Basically all that needs to be done is to empty this function, and I'm all done. I'm working on that step now.

Ehtyar.

Navigation

[0] Message Index

Go to full version