Question: how to handle differences between Chrome and Mozilla
See original GitHub issueHey there,
I’m just converting a fairly complex extension to TypeScript, and I appreciate the effort you have put into this library!
My question is: do you have any thoughts on best practices between different browser flavours, now that TypeScript’s strong typing is going to highlight differences between the APIs?
For example, Chrome’s tab update method:
browser.tabs.update(someId, { autoDiscardable: false })
TS2345: Argument of type '{ autoDiscardable: boolean; }' is not assignable to parameter of type 'UpdateUpdatePropertiesType'.
The simple answer is to cast as any and the problem goes away, but do you have any better advice, plans for future versions, or other suggestions?
Is this the right library to develop Chrome extensions, or is this just something we have to cope with, with the newfound power that comes with TS?
Many thanks, Dave
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Firefox vs. Chrome: Which is better? - Mozilla
We compare Mozilla Firefox with Google Chrome in terms of privacy, utility and portability.
Read more >Mozilla Firefox vs Google Chrome - GeeksforGeeks
Firefox and Google Chrome both are widely used web browsers and both of these have a number of features to ease browsing.
Read more >Firefox vs Chrome 2022 [Mozilla vs Google Browser Showdown]
Chrome is faster and has a larger library of extensions, but Firefox is more private and secure. Firefox is fast, but suffers from...
Read more >8 compelling reasons to quit Chrome and switch to Firefox
8 compelling reasons to quit Chrome and switch to Firefox · Automatic blocking of autoplay videos · Speedier website browsing · Lighter on...
Read more >Firefox vs Google Chrome - Difference and Comparison - Diffen
Mozilla Firefox and Google Chrome are both based on open-source web browser ... are some significant differences between them, as there are similarities....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think that’s a great idea!
It would be great if you would outline your ideas of why the library exists and what its aims should be as well.
Looking forward to it! (but no rush)
FYI a nice TS tute of the Visitor pattern popped up in my fees today. Might be nice to hyperlink it:
https://dev.to/alfki/the-visitor-pattern-exemplified-in-typescript-4cp5