What is the most rudimentary way to update url of a current tab in chrome sync?

8 views
Skip to first unread message

Tomas Novella

unread,
Aug 25, 2015, 5:29:46 AM8/25/15
to Chromium-extensions
Hi, 
I want a create an extension that would list all the open tabs(sending a query to chrome sync server) + I could add my own open tabs.
With the first thing (asking for tabs) I was succesfull. WIth the second thing(adding artificially a new tab) I was not.

I tried something like this and it did work partially:

 let request = new clientToServerRequest.rootProto.ClientToServerMessage({
    share: db.getUserShare(),
    message_contents: 'COMMIT',
    commit: {
      config_params: {
        enabled_type_ids: [50119],
        tabs_datatype_enabled: true
      },
      entries: [{ 
        name: websiteUrl,  // shouldn't be important although must be filled
        non_unique_name: websiteUrl,

        // it's only 13 digits in JS in comparison to 16 used by chrome, hence the multiplication...
        version: currentTime * 1000,

        // id_string should uniquely identify the session tab -> I need to find the id_string of current tab via update request for example...
        id_string: 'Z:ADqtAZxYtpOdmzFl4Fx/ECWEY2U2xytR+HKbgS6Ud13Bb9BHEPoxUw13MrSWNggmBakjrFWFtkZvaCM9eYPsYvwo8D1I1hlzWw==',
        specifics: {
          "session": {
            "tab": {
              "navigation": [
                {
                  "title": "Title of the new page I opened in the tab",
                  "virtual_url": "http://www.google.com/FOO.HTML"
                }
              ],
              // tab which I want to push this new thing to
              "tab_id": 1027,
              "window_id": 637
            },
          }
        }
      }]
    }
)};


The problem with this is that after using it a couple of times the whole chrome sync stopped working. It means that even if I open some new tabs in chrome, it doesn't "record" them (any query for the open tabs returns me the same result no matter how many new tabs I already opened).
On the other hand, it sure does update the latest open tab (=the latest opened tab is the one added with this function  - FOO.HTML), but it still does not change the old tabs even if I use chrome regularly. 

When I tried it on a different account it didn't update the newest tab,  but at least didn't blow the sync service up (when I browsed with chrome, the new tabs I opened were updated)...

What am I missing on this funcion, that it doesn't work properly?

Thank you.

Tomas Novella

unread,
Aug 25, 2015, 6:21:38 AM8/25/15
to Chromium-extensions
Edit: after about 3 days I got "unblocked" - chrome leaves the trace after browsing. 
Still, it's pretty weird, that the service just stopped working + I'm not sure if this skeleton is a good one, or  I should change it anyhow...
Let's say my task is: "push URL=http://mytesturl.com" to the history of my third tab, whose id_string is 123.
Reply all
Reply to author
Forward
0 new messages