diff --git a/actions.js b/actions.js index f28e315..b6422d7 100644 --- a/actions.js +++ b/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) => () => { diff --git a/keys.js b/keys.js index c284024..09c4949 100644 --- a/keys.js +++ b/keys.js @@ -159,6 +159,12 @@ const maps = { description: "Subscribe to RSS feed for page", callback: actions.rssSubscribe(), }, + { + alias: "=s", + category: categories.misc, + description: "Speed read page", + callback: actions.showSpeedReader, + }, { alias: ";pd", category: categories.misc,