Perspectives
Perspectives copied to clipboard
Extract platform-specific code
If we want to easily port Perspectives to multiple platforms (like Chrome, Android, or Thunderbird) it would be very useful if we knew exactly what functionality was needed from each platform, and where it should be implemented.
Let's extract all of the browser- or platform-specific code into one place (browser.js?). The main Perspectives code should be able to call a wrapper function such as getLocalizedString() or getUserPref(). Each wrapper function will take the appropriate action for the current platform.
Things to Extract
- getString()
- getFormattedString()
- getUserPref()
- setUserPref()
- interacting with the user, such as popups or dialogs for asking questions / displaying information
- each UI will need to be separated, and the input captured
- events such as when the page has finished loading
- browser-specific icons for e.g. the Certificate Store window. Do we have the rights to include an icon for each browser inside the depo? Can we find a way to load that window that automatically uses the browser's built-in icon?
Other Work
- We'll need a build script to extract localized strings and output them in the format expected by each platform. The good news is we can share localizations! We could split this into a separate ticket.
Once #171 and #172 are done we could ideally remove the need for Perspectives.init_data() altogether.