[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.rssSubscribe = ({ href = util.getCurrentLocation("href") } = {}) =>
|
||||||
() => actions.openLink(`${rssSubscribeUrl}${encodeURIComponent(href)}`, { newTab: true })()
|
() => 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
|
// Surfingkeys-specific actions
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
actions.createHint = (selector, action) => () => {
|
actions.createHint = (selector, action) => () => {
|
||||||
|
|
6
keys.js
6
keys.js
|
@ -159,6 +159,12 @@ const maps = {
|
||||||
description: "Subscribe to RSS feed for page",
|
description: "Subscribe to RSS feed for page",
|
||||||
callback: actions.rssSubscribe(),
|
callback: actions.rssSubscribe(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
alias: "=s",
|
||||||
|
category: categories.misc,
|
||||||
|
description: "Speed read page",
|
||||||
|
callback: actions.showSpeedReader,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
alias: ";pd",
|
alias: ";pd",
|
||||||
category: categories.misc,
|
category: categories.misc,
|
||||||
|
|
Loading…
Reference in New Issue