網路上的window.speechSynthesis教學主要都只有說切換指定語言
像是這樣就能切換成中文語音:
const synth = window.speechSynthesis;
const speak = (msg) => {| #!/bin/bash | |
| # | |
| # Extracts the source code of any Docker tag! | |
| # Inspired by Sambhav Jain's post on DEV: https://dev.to/sambhav2612/reverse-engineering-a-docker-image-i8c | |
| # Simply pass: | |
| # 1. The desired Docker image tag you want to get the source code for | |
| # 2. The target folder to put the source code in | |
| # | |
| # Example usage: | |
| # ./export-source-from-docker-tag.sh gcr.io/google-samples/gb-frontend:v4 docker-source |
| // ==UserScript== | |
| // @name 新しいスクリプト 421815 | |
| // @version 1 | |
| // @match https://wiki.greasespot.net/GM.xmlHttpRequest | |
| // @match http://example.com/ | |
| // @grant GM.xmlHttpRequest | |
| // ==/UserScript== | |
| function get(url) { | |
| return new Promise(resolve => { |
| // ts 3.6x | |
| function debounce<T extends Function>(cb: T, wait = 20) { | |
| let h = 0; | |
| let callable = (...args: any) => { | |
| clearTimeout(h); | |
| h = setTimeout(() => cb(...args), wait); | |
| }; | |
| return <T>(<any>callable); | |
| } |
| Write-Host "--- Running Windows Update ---" | |
| Write-Host "Searching for updates..." | |
| $updateSession = new-object -com "Microsoft.Update.Session" | |
| $updateSearcher = $updateSession.CreateupdateSearcher() | |
| $searchResult = $updateSearcher.Search("IsInstalled=0 and Type='Software' and AutoSelectOnWebSites=1") | |
| Write-Host "List of applicable items on the machine:" | |
| if ($searchResult.Updates.Count -eq 0) { | |
| Write-Host "There are no applicable updates." | |
| } | |
| else |
| // Scroll to selection focus, but only if it's out of view. Align selection | |
| // focus with the top or bottom edge of its scroll-container. Return true | |
| // on success. | |
| // * there might be several nested scroll-containers, including window | |
| // * must not try to scroll overflow:hidden and overflow:visible elements | |
| // * no scrolling should happen if selection focus is visible | |
| // * selection is not necessarily collapsed | |
| // * range.getBoundingClientRect doesn't work for collapsed ranges | |
| // * Opera reports incorrect startOffset and endOffset for collapsed ranges | |
| // outside of text nodes (e.g. between 2 <br> elements), range.insertNode |