[src/keys:feat] toggle speed reader on page
using squirt.io
This commit is contained in:
parent
233707c5df
commit
015d236886
18
actions.js
18
actions.js
|
@ -75,6 +75,24 @@ const rssSubscribeUrl = "https://feedrabbit.com/subscriptions/new?url="
|
|||
actions.rssSubscribe = ({ href = util.getCurrentLocation("href") } = {}) =>
|
||||
() => actions.openLink(`${rssSubscribeUrl}${encodeURIComponent(href)}`, { newTab: true })()
|
||||
|
||||
actions.showSpeedReader = () => {
|
||||
const script = document.createElement("script")
|
||||
script.innerHTML = `(() => {
|
||||
const sq = window.sq || {}
|
||||
window.sq = sq
|
||||
if (sq.script) {
|
||||
sq.again()
|
||||
} else if (sq.context !== "inner") {
|
||||
sq.bookmarkletVersion = "0.3.0"
|
||||
sq.iframeQueryParams = { host: "//squirt.io" }
|
||||
sq.script = document.createElement("script")
|
||||
sq.script.src = \`\${sq.iframeQueryParams.host}/bookmarklet/frame.outer.js\`
|
||||
document.body.appendChild(sq.script)
|
||||
}
|
||||
})()`
|
||||
document.body.appendChild(script)
|
||||
}
|
||||
|
||||
// Surfingkeys-specific actions
|
||||
// ----------------------------
|
||||
actions.createHint = (selector, action) => () => {
|
||||
|
|
Loading…
Reference in New Issue