topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 11:39 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Firefox Extension Coding - Stop Those Livemarks  (Read 6862 times)

Ehtyar

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,237
    • View Profile
    • Donate to Member
Firefox Extension Coding - Stop Those Livemarks
« on: June 19, 2008, 05:38 PM »
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

  • Member
  • Joined in 2006
  • **
  • Posts: 2,374
    • View Profile
    • Donate to Member
Re: Firefox Extension Coding - Stop Those Livemarks
« Reply #1 on: June 19, 2008, 05:46 PM »
Did you try setting it up to 0, -1 or an obscenely high number?
« Last Edit: June 19, 2008, 05:57 PM by Lashiec »

Ehtyar

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,237
    • View Profile
    • Donate to Member
Re: Firefox Extension Coding - Stop Those Livemarks
« Reply #2 on: June 19, 2008, 05:56 PM »
Did you try setting it up to "-1" or an obscenely high number?
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

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 50
    • View Profile
    • Donate to Member
Re: Firefox Extension Coding - Stop Those Livemarks
« Reply #3 on: June 20, 2008, 10:21 AM »
why does it bother you that it updates?

Ehtyar

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,237
    • View Profile
    • Donate to Member
Re: Firefox Extension Coding - Stop Those Livemarks
« Reply #4 on: June 20, 2008, 03:57 PM »
why does it bother you that it updates?
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.