Skip to content

Conversation

@0x6362
Copy link
Contributor

@0x6362 0x6362 commented Nov 13, 2024

@artemave: Tried to keep this in the style of the existing code and refactor as little as possible, very much an MVP of the functionality to get your feedback

RE: storage and export. Went with JSON instead of CSV, which possibly less accessible to users by default. Happy to create a setting to support export in either.

Other call out is the addition of the dexie dependency. I would prefer not to implement code for handling IndexedDB migrations/schema changes myself, but I've done it before and can do it here if you would prefer not to add a dep.


  • Adds Setting, defaulting to "On", enabling recording/logging of translated words for later export, e.g. to convert into Anki cards
  • Adds button to the TransOver Popup Window to save history of translated words

TODO

  • Test in Chrome
  • Test in browsers still using v2 Manifest?

@artemave
Copy link
Owner

RE: storage and export. Went with JSON instead of CSV, which possibly less accessible to users by default. Happy to create a setting to support export in either.

Probably best to add CSV as a follow up pr.

@artemave
Copy link
Owner

Other call out is the addition of the dexie dependency

Adding dexie seems reasonable to me.

This was referenced May 4, 2025
@mrkeuz
Copy link

mrkeuz commented May 4, 2025

@0x6362 hi from beta-tester, I've built and installed it on

  • Brave Brave [1.77.101 Chromium: 135.0.7049.115]
  • Pure Chromium 136.0.7103.59

What I found:

  1. It need to set API_SECRET and MEASUREMENT_ID for yarn build (Just FYI)
  2. Download history button does NOT work with error in both browsers:
background.js:1 get_last_tat_sl_tl
background.js:1 Uncaught (in promise) TypeError: URL.createObjectURL is not a function
    at q (background.js:1:111738)
q @ background.js:1
await in q
...
case "exportTranslationHistory":
            await x.store_translations() && (r = await j.translations.toArray(),
            o = JSON.stringify(r),
            i = new Blob([o],{
                type: "application/json"
            }),
            r = URL.createObjectURL(i),  //<- Here
            browser.downloads.download({
                url: r,
                filename: "translation_history.json",
                saveAs: !0
            }));
            break;
...

UPD: Found this after googling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants