Background
As part of T376374, we need to deliver pre-generated simplified summaries for a list of about 10,000 articles. The goal of this task is to validate the proposed implementation strategy for storing and delivering those summaries.
Technical Proposal
In order to present simplified summaries through the browser extension, we can do the following:
Storage
- Inside the browser extension, create a folder with 10,000 plain text files.
- Each file name should correspond to an article title.
- The content of each file contains the simplified summary for the title.
- summaries/
- Dog.txt
- Earth.txt
- Dopamine.txtBrowser extension Retrieval
- In a background script, create a postMessage event listener.
- Using the chrome APIs, retrieve the specific summary file for the given title, via URL, and read the contents of that file.
- e.g. const url = chrome.runtime.getURL('/summaries/Dopamine.txt'); fetch(url);
- Respond to the postMessage event with the contents of that file.
On-page script retrieval
- On the on-page script, create a window.postMessage call that provides the page title.
- The postMessage response should contain the simplified summary.
Acceptance criteria
The goal of this task is to validate the approach suggested above. Some open questions include:
- Is it ok to upload a directory with 10,000 files?
- Does the proposed approach affect the chrome store approval process in any way?
- What is the bytesize payload of the summaries (it's estimated to be about 10-15mb, is that true?)
- Can the browser extension read the file contents? Do we need special permissions to do that?
- Does the window.postMessage between the browser extension and on-page script work as expected?
IF It turns out the suggested approach is not viable, propose an alternative strategy, e.g. Should we host the summaries on a static server instead of inside the browser extension? or use a web-based database like IndexedDB instead?
QA
This does not need QA.
