question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: how to handle differences between Chrome and Mozilla

See original GitHub issue

Hey 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:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
davestewartcommented, Jun 25, 2020

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)

0reactions
davestewartcommented, Jul 7, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found