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
let formEl = chrome.runtime.templates.get('feedbackForm'); | |
someDOMEl.insert(formEl); |
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
chrome.webNavigation.onHistoryStateUpdated.addListener(onNavigate.bind(this)); | |
function onNavigate() { | |
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { | |
chrome.tabs.sendMessage(tabs[0].id, {'action': 'route'}); | |
}); | |
} |
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
/** | |
* Check out and return el when it will be render | |
* @param {string} query - string containing CSS selector | |
* | |
* @example | |
* const mountElClassName = '.mountEl'; | |
* | |
* isRenderedDOMElement(mountElClassName).then((el) => { | |
* el.append('Your included html'); | |
* }).catch(() => { |
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
function makeSnapshot(id) { | |
var video = document.getElementById(id), // video tag | |
canvas = document.createElement('canvas'), | |
context = canvas.getContext('2d'), | |
dataURL, | |
blob; | |
if (video) { | |
canvas.width = video.clientWidth; | |
canvas.height = video.clientHeight; |
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
/** | |
* Before you init QB by `QB.init()` | |
*/ | |
/** | |
* [getUui - generate a unique id] | |
* @return {[string]} [a unique id] | |
*/ | |
function _getUui() { | |
var navigator_info = window.navigator; |