Last active
July 17, 2019 15:17
-
-
Save webmaster128/3b0572211cbaf491f3fbc730fd9237c6 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
// create some methods in the background script that can be called from the UI | |
window.getBinary = () => new Uint8Array([1, 2, 3]); | |
window.getUint8ArrayConstructor = () => Uint8Array; |
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
const binary = chrome.extension.getBackgroundPage().getBinary(); | |
console.log(binary instanceof Uint8Array); // false 🤯 | |
const constructor = chrome.extension.getBackgroundPage().getUint8ArrayConstructor(); | |
console.log(binary instanceof constructor); // true | |
console.log(constructor === Uint8Array); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment