Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

270
Views
browser.d.ts dependency for Edge web extension APIs browser.runtime.* in typescript

For chrome extension developed using typescript, we need a definition file called chrome.d.ts in typings folder for accessing web extension APIs like chrome.runtime.* or chrome.tabs.*.

For edge extension, developing in typescript, we need a definition file called browser.d.ts in typings folder for accessing web extension APIs like browser.runtime.*

How can we download this dependency using node package manager(npm). I added a reference to the file in my background.ts file of extension like:

/// reference path="typings/browser/browser.d.ts"

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Update:

Typings are available for Firefox's browser API and its browser polyfill library.

  • Firefox typings: npmjs.com/package/@types/firefox-webext-browser
  • Typings for browser polyfill: npmjs.com/package/webextension-polyfill-ts

Unfortunately, Edge's browser API is not the same as Firefox's. Edge uses callbacks while Firefox uses Promises. This may or may not change.

See:

  • https://github.com/mozilla/webextension-polyfill/issues/3
  • https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9421085/
over 4 years ago · Santiago Trujillo Report

0

Since you need browser.d.ts only for type conversion this solution will work

You can add:

declare var browser: any;

at the top of your file where you are using browser.runtime.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!