- Démo d'utilisation d'un screenreader: https://www.webassoc.fr/agenda/accessibilite-180314/
- Lighthouse 3: http://bit.ly/lighthouse-3-details
- Chrome User Experience Report: http://bit.ly/chrome-ux-report
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
window.browser = (function () { | |
return window.msBrowser || | |
window.browser || | |
window.chrome; | |
})(); |
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
console.log("Dare Angel content script started"); | |
browser.runtime.onMessage.addListener(function (request, sender, sendResponse) { | |
if (request.command == "requestImages") { | |
var images = document.getElementsByTagName('img'); | |
var imagesList = []; | |
for (var i = 0; i < images.length; i++) { | |
if ((images[i].src.toLowerCase().endsWith(".jpg") || images[i].src.toLowerCase().endsWith(".png")) | |
&& (images[i].width > 64 && images[i].height > 64)) { | |
imagesList.push({ url: images[i].src, alt: images[i].alt }); |
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
browser.tabs.query({ active: true, currentWindow: true }, (tabs) => { | |
browser.tabs.sendMessage(tabs[0].id, { command: "requestImages" }, (response) => { | |
this._imagesList = JSON.parse(response); | |
this._imagesList.forEach((element) => { | |
var newImageHTMLElement = document.createElement("img"); | |
newImageHTMLElement.src = element.url; | |
newImageHTMLElement.alt = element.alt; | |
newImageHTMLElement.tabIndex = this._tabIndex; | |
this._tabIndex++; | |
newImageHTMLElement.addEventListener("focus", (event) => { |
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
analyzeThisImage(url) { | |
var xhr = new XMLHttpRequest(); | |
xhr.onreadystatechange = () => { | |
if (xhr.readyState == 4 && xhr.status == 200) { | |
var response = document.querySelector('#response'); | |
var reponse = JSON.parse(xhr.response); | |
var resultToSpeak = `With a confidence of ${Math.round(reponse.description.captions[0].confidence * 100)}%, I think it's ${reponse.description.captions[0].text}`; | |
console.log(resultToSpeak); | |
if (!this._useBingTTS || BINGSPEECHKEY === "") { | |
var synUtterance = new SpeechSynthesisUtterance(); |
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
// Manually install the braveExtension and torrentExtension | |
extensionInfo.setState(config.braveExtensionId, extensionStates.REGISTERED) | |
loadExtension(config.braveExtensionId, getExtensionsPath('brave'), generateBraveManifest(), 'component') | |
extensionInfo.setState('DareAngel', extensionStates.REGISTERED) | |
loadExtension('DareAngel', getExtensionsPath('DareAngel/')) |