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

29 views
Skip to first unread message

Tomas Novella

unread,
Aug 24, 2015, 8:49:02 AM8/24/15
to Chromium-dev
Hi, 
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/my_new_page_should_be_saved.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 (doesn't even record tabs I open regularly in Chrome). EVEN THOUGH it sure does update the latest open tab. 

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 updated)...

Thank you.

Tomas Novella

unread,
Aug 24, 2015, 9:28:43 AM8/24/15
to Chromium-dev
Another funny thing even on the working account is that now, it updates the last active tab and returns error code=2 (wrong birthday) - because I haven't filled any birthday.
When I do feed it with birthday I received in last update request, it returns a  corrupted protocol buffer message (at least according to the https://github.com/dcodeIO/ProtoBuf.js/ library)  

Lei Zhang

unread,
Aug 24, 2015, 3:44:04 PM8/24/15
to tomasn...@gmail.com, Chromium-dev
You should email the chromium-extensions mailing list. Chromium-dev is
for the development of the browser itself, not extensions. See
descriptions here:
https://www.chromium.org/developers/discussion-groups
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev

Tomas Novella

unread,
Aug 25, 2015, 5:21:54 AM8/25/15
to Chromium-dev, tomasn...@gmail.com
I though that since it's about the sync protocol - which is not inherently a part of an extension , this would be a better place.
But ok, thanks, will post there.

Anton Vayvod

unread,
Aug 25, 2015, 7:23:15 AM8/25/15
to tomasn...@gmail.com, Chromium-dev
Is the sync protocol intended to be used by third-party extensions or pages?

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Tomas Novella

unread,
Aug 25, 2015, 11:35:10 AM8/25/15
to Chromium-dev, tomasn...@gmail.com, ava...@chromium.org
I don't know, but it's not prohibited, that's for sure. 
Now that the 4-day blockage is over (sync works again), I'm still wondering as to why it didn't work (was it on purpose?) and if I can do something better...

Antony Sargent

unread,
Aug 26, 2015, 11:57:46 AM8/26/15
to tomasn...@gmail.com, Chromium-dev, ava...@chromium.org
Wait, are you trying to manually create custom protocol buffer messages and send them directly to the sync server? That's definitely not something we support as far as I know. Chrome sync is a service intended only to implement the syncing functionality within the chrome browser (eg syncing things like history, autofill, bookmarks, etc.), and isn't intended to expose an API. 

We do however provide an API within the extensions system that lets extensions store and sync relatively small amounts of arbitrary data for their own use. This is most frequently used for things like settings/configuration, but could also be used as a communication channel for a low volume of messages between copies of an extension running on different machines.

You can also have an extension periodically poll, or keep a persistent connection (eg with "hanging GET" requests or websockets) to a server under your control. 



Reply all
Reply to author
Forward
0 new messages