Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Fix colorscheme example #56

Merged
merged 1 commit into from
Nov 4, 2021
Merged

Fix colorscheme example #56

merged 1 commit into from
Nov 4, 2021

Conversation

inancgumus
Copy link
Member

@inancgumus inancgumus commented Nov 4, 2021

The browser launcher doesn't need to know about the preferred color scheme. It is the browser context's job.

Instead of getting the preferred color scheme from an element, the new script gets it from the window object (through the current browser context).

Fixes #46

* Browser launcher doesn't know about the preferred color scheme.
  Browser context knows about color schemes
  This fix moves it to the browser context.

* Instead of getting the preferred color scheme from an element,
  the new script gets it from the window object.

Fixes #46
@inancgumus inancgumus requested a review from imiric November 4, 2021 14:19
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No wonder it didn't work 😄 Maybe we should add some validation and throw an error on unknown properties to help people who don't RTFM? 😅

Also, I wasn't aware of window.matchMedia(). Good stuff!

@inancgumus
Copy link
Member Author

No wonder it didn't work 😄 Maybe we should add some validation and throw an error on unknown properties to help people who don't RTFM? 😅

Good idea! See: grafana/k6#4495

@inancgumus inancgumus merged commit 0090d6b into main Nov 4, 2021
@inancgumus inancgumus deleted the fix/46 branch November 4, 2021 15:57
inancgumus added a commit that referenced this pull request Nov 9, 2021
Fix colorscheme example
@inancgumus inancgumus self-assigned this Jan 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

colorScheme doesn't seem to work
2 participants