• Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    Do more on the web, with a fast and secure browser!

    Download Opera browser with:

    • built-in ad blocker
    • battery saver
    • free VPN
    Download Opera

    side bar behaviour

    Opera add-ons
    2
    4
    1056
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Former User
      A Former User last edited by

      there are couple of thing that I've stumble upon doing ext for SB
      First one is some sort of race condition between firing freshly installed extension and chrome.runtime.onInstalled.addListener
      If extension needs to set first default data to localStorage (chrome.storage) it will create error, because there is no time for SB panel to read it (I'm listening onInstalled in bg script)
      I don't have much of experience with browserAction (popup) extensions, maybe this is some common thing and easy to solve. I had to put check up on every start to see if there is something in storage, otherwise ext get bugged

      Second, if user opens two (or more) windows with SB, extension data (whatever that is) is kept in old state. Eg. if I open side bar, do something in my extension, and then I create new window (SB is automatically opened with it), and change extension data somehow, extension in first window side bar is not updated. So when I go back to it, SB extension is showing me old data.
      This could create errors (or worst) if user tries to change old data.
      I can listen for win focus change, and update ext. data, but that creates update in all extension views (in every SB of every window opened) or annoying refreshing on every focusing of window with SB (even if it's just one browser window)
      Is there any better logic for those situations?
      maybe some internal algorithm (in development) that will take care of it ?

      Reply Quote 0
        1 Reply Last reply
      • shwetankdixit
        shwetankdixit last edited by

        The behavior here is intended. Not every extension would need such live syncing and for many of them it's even unwelcomed. It's much easier for developers to make an extension that does the syncing on its own then workaround it (assuming that the syncing would be embedded). How to cope with the problem depends on what your extension does and what you want to achieve. In some cases changing an architecture to multi-transactional may be sufficient. However, in most (or even all) cases using message mechanism and background page as an arbiter will do the trick. It's hard to give you precise advice with limited knowledge of your extension functionality however. In the next version we plan to add onFocus/onBlur events (it may be helpful in some cases too) but much more reliable solution still seems to be sending messages to the background page.

        Reply Quote 0
          1 Reply Last reply
        • A Former User
          A Former User last edited by

          I'm sorry, I didn't saw this post until now (didn't get notification)
          In latest dev (30) I'm not sure if my problem with windows is still there...maybe something is changed
          Honestly, didn't have much time to test that particular extension (tabs in sidebar) because of work on other ext's.
          I'm starting to work on it again (paused for week or so), and if I stumble on something I'll write it here...

          But the first issue is giving me more headache...race between chrome.runtime.onInstalled and fist firing of ext after installation
          there is no time to set default data
          I used msg in callback chrome.storage.local.set to refresh the extension after the data is set, but I'm not sure how smart is that

          Reply Quote 0
            1 Reply Last reply
          • A Former User
            A Former User last edited by

            I see that in latest dev 30.0.1820.0 there is no more auto start SB extension after install 🆙

            Reply Quote 0
              1 Reply Last reply
            • First post
              Last post

            Computer browsers

            • Opera for Windows
            • Opera for Mac
            • Opera for Linux
            • Opera beta version
            • Opera USB

            Mobile browsers

            • Opera for Android
            • Opera Mini
            • Opera Touch
            • Opera for basic phones

            • Add-ons
            • Opera account
            • Wallpapers
            • Opera Ads

            • Help & support
            • Opera blogs
            • Opera forums
            • Dev.Opera

            • Security
            • Privacy
            • Cookies Policy
            • EULA
            • Terms of Service

            • About Opera
            • Press info
            • Jobs
            • Investors
            • Become a partner
            • Contact us

            Follow Opera

            • Opera - Facebook
            • Opera - Twitter
            • Opera - YouTube
            • Opera - LinkedIn
            • Opera - Instagram

            © Opera Software 1995-