From ba34618a09fd78f9aed3c22c0708aeb0ac02bcdc Mon Sep 17 00:00:00 2001 From: hbt Date: Wed, 11 Jan 2017 17:13:58 -0500 Subject: [PATCH] fixed #14 - transform urls into clickable links on the page Case: - visit page where URLs are in plain text instead of clickable url - select url and copy paste into address bar Solution: - new setting automakelinks transforms pages automatically - new command makeLinks transforms them on command New settings: - set automakelinks New Command: - map ml makeLinks --- background_scripts/options.js | 1 + content_scripts/keys.js | 3 +++ content_scripts/mappings.js | 3 +++ 3 files changed, 7 insertions(+) diff --git a/background_scripts/options.js b/background_scripts/options.js index 20f71a77..44be335d 100644 --- a/background_scripts/options.js +++ b/background_scripts/options.js @@ -6,6 +6,7 @@ var defaultSettings = { experimental: false, searchlimit: 25, scrollstep: 70, + automakelinks: false, fullpagescrollpercent: 0, typelinkhintsdelay: 300, qmarks: {}, diff --git a/content_scripts/keys.js b/content_scripts/keys.js index 7f375eab..de473925 100644 --- a/content_scripts/keys.js +++ b/content_scripts/keys.js @@ -924,5 +924,8 @@ window.addEventListener('DOMContentLoaded', function() { alert(message); } }); + if(settings.automakelinks) { + document.body.innerHTML = document.body.innerHTML.transformURL() + } } }); diff --git a/content_scripts/mappings.js b/content_scripts/mappings.js index 89091823..14c5f381 100644 --- a/content_scripts/mappings.js +++ b/content_scripts/mappings.js @@ -797,6 +797,9 @@ Mappings.actions = { RUNTIME('copyURLDownloads', function(o) { console.log(o) }) + }, + makeLinks: () => { + document.body.innerHTML = document.body.innerHTML.transformURL() } };