'How can I make an http request in the service worker chrome extension?

i am trying to develope a chrome extension ,now background scripts are replaced by service workers in manifest v3, How can I make an http request in the service worker?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source