-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It has several problems: first of all, it initializes DOM stuff at load time, which means you can't choose to postpone loading the polyfill into you're sure you're not in some isolated environment that disallows creating elements. Secondly, it doesn't set willReadFrequently which recent chromiums started generating warnings about (even though in practice this doesnt matter, given how few pixels we read). Replaced it all by an implementation taken from TalkJS core, which in turn is a mish-mash of ideas from if-emoji and emoji-picker-element. Notably, it renders into a 1-pixel canvas which is just genius.
- Loading branch information
1 parent
0327203
commit 516b0cb
Showing
6 changed files
with
676 additions
and
112 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<title>country-flag-emoji-polyfill</title> | ||
<script type="module" defer> | ||
import { polyfillCountryFlagEmojis } from "../../dist/index.module.js"; | ||
polyfillCountryFlagEmojis(); | ||
</script> | ||
<style> | ||
* { | ||
font-family: "Twemoji Country Flags", serif; | ||
} | ||
</style> | ||
|
||
<h1>country-flag-emoji-polyfill local-dev test page</h1> | ||
<p> | ||
Run a dev server on the repository root, then open this page in your browser at <code>http://localhost:PORT/examples/local</code> | ||
|
||
<p> | ||
If it works, this is a flag on all browsers, including Chrome-based browsers on Windows: | ||
|
||
<p style="font-size: 4em"> | ||
🇫🇮 | ||
|
||
</html> |
Oops, something went wrong.