'google chrome's 'Copy styles' button using browser's API instead

In Google chrome they have a the copy styles button feature since V77

But can't figure out how to use it using the Browser's API

I have tried getComputedStyle but apparently the result is not what's expected (it has a more styles than needed)

If we compared the result of "Copy styles" available in google chrome dev tools GUI and the browser's getComputedStyle for a any element

After "copy styles" the result would look like this:

-webkit-font-smoothing: antialiased;    
-webkit-text-size-adjust: 100%;    
color: rgba(0,0,0,0.87);     
box-sizing: inherit;    
position: fixed;    
z-index: 1300;  
right: 0;
bottom: 0; 
top: 0; 
left: 0;

While getComputedStyles has a lot more than these styles (a whole lot more)

Where I expect to have another API that can copy css just like the "copy styles" button



Sources

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

Source: Stack Overflow

Solution Source