cnwangjie / better-onetab

:bookmark_tabs: A better OneTab for Chrome :memo: Temporarily removed from firefox :construction: V2 is WIP
https://chrome.google.com/webstore/detail/better-onetab/eookhngofldnbnidjlbkeecljkfpmfpg
MIT License
1.67k stars 284 forks source link

feat: enable sync to browser account #356

Closed WqyJh closed 3 years ago

WqyJh commented 3 years ago

Implement #355

WqyJh commented 3 years ago

Here is an zipped build tested on Chrome on two PCs, which could successfully sync data with my google account.

Usage

Open two chrome installation (maybe in two PCs) and log in with same google account. Then perform the following action for both of the chrome.

  1. Download dist.zip
  2. Unzip it into folder dist/
  3. Click LOAD UNPACKED button and select dist/ path

First you add a tab to one of the better-onetab, refresh the page, wait for seconds. Then you open another better-onetab you should see the added tab. The time for sync depends on your network, you may need an proxy to access google. In my experience, it just several seconds with some refresh.

Development

If you want to test with your build, just add an key to manifest.json and build as below and build, you'll get an dist with stable ID which enables synchronize between multiple devices.

{
   "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5MjBbnZCLkCC6nc4Ssp3u2zQ57Nw5G00CZ44CYfuBskn08BFVNgtzl5pd4Sc4RlTktbL1DzkgIE33PcKAd0+QXVaM7vpRE7ydN84+ONjIFNFFSJo+EQh7aIOffQy/aTMRTdGrzhxe49++VlKSFOKrO3Cb1k/GgMP+vWdlPztNzc2pgjHeG4vBvQubHWWb6udgPTr0LkFwmv84m48cXX6mvBaF1Taqk0qj0utFZpg2CFLIwTKIcTGrnA4/ijO1B7lz40pJxMYzq052F29vdxtI19oxtU/vqZ4b0Gcc4XC6vb7EwU4ZVvIACzQKgJixnUh8UJZyroDPu8buK4mJBbS4wIDAQAB",
}
WqyJh commented 3 years ago

In fact, storage.sync would lost data if you close or refresh page before it successfully save it to server. It didn't seem to store data locally like storage.local.

I think there's much more work to support storage.sync, therefore I think it's better to close it first.

WqyJh commented 3 years ago

In fact, storage.sync would lost data if you close or refresh page before it successfully save it to server. It didn't seem to store data locally like storage.local.

I think there's much more work to support storage.sync, therefore I think it's better to close it first.

After I removed the dist/ package and install version 1.4.7 from chrome extension store, I've got the same problem of data lost. Seems it's not the storage api causing the data lost. storage.sync behaves same with storage.local.

Please look into #349.