Firefox extension opening a page on install

前端 未结 2 1701
借酒劲吻你
借酒劲吻你 2020-12-10 09:33

I noticed some Firefox extensions when installed will open up a page once you restart the browser, for example the StumbleUpon toolbar.

This is useful to show update

2条回答
  •  失恋的感觉
    2020-12-10 09:58

    I have not worked directly with firefox extensions, but I would imagine something along the lines of storing a flag(boolean value) in persistent memory (however you store user preferences). When the browser starts the first time after the install, the flag would not be set, so you display the help page and set the flag. Next time firefox restarts, the flag will already have been set, so you don't open the help page.

    If you wanted it to show a page every time the extension was updated, then store the version instead of a boolean, and on each startup check if the current version is greater than that of the stored one.

提交回复
热议问题