Skip to content

Instantly share code, notes, and snippets.

@just-jeb
Created June 30, 2022 10:56
Show Gist options
  • Save just-jeb/16bd6449ace4337986b4b9280e5ea14e to your computer and use it in GitHub Desktop.
Save just-jeb/16bd6449ace4337986b4b9280e5ea14e to your computer and use it in GitHub Desktop.
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