Created
June 30, 2022 10:56
-
-
Save just-jeb/16bd6449ace4337986b4b9280e5ea14e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class AppComponent implements OnInit { | |
color = '#ffffff'; | |
public colorize() { | |
chrome.tabs.query({ active: true, currentWindow: true }, tabs => { | |
chrome.scripting.executeScript({ | |
target: { tabId: tabs[0].id! }, | |
func: updateBackgroundColor, | |
args: [this.color] | |
}); | |
}); | |
} | |
} | |
const updateBackgroundColor = (color: string) => document.body.style.backgroundColor = color; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment