├── README.md ├── src ├── metabase-links.js ├── background.js ├── manifest.json └── autolink-min.js └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # Metabase Links for Chrome 2 | 3 | This Chrome Extension automatically turns all links from Metabase result to 4 | clickable links. 5 | 6 | ## License 7 | 8 | MIT License 9 | -------------------------------------------------------------------------------- /src/metabase-links.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | NodeList.prototype.forEach = Array.prototype.forEach; 3 | document.querySelectorAll('span.cellData').forEach(function(el) { 4 | el.innerHTML = el.innerText.autoLink({ target: "_blank" }); 5 | }); 6 | })(); 7 | -------------------------------------------------------------------------------- /src/background.js: -------------------------------------------------------------------------------- 1 | chrome.browserAction.onClicked.addListener(function(tab) { 2 | // No tabs or host permissions needed! 3 | chrome.tabs.executeScript({ 4 | file: 'autolink-min.js' 5 | }); 6 | chrome.tabs.executeScript({ 7 | file: 'metabase-links.js' 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Metabase Links", 4 | "version": "1.0", 5 | "permissions": [ 6 | "activeTab" 7 | ], 8 | "background": { 9 | "scripts": ["background.js"], 10 | "persistent": false 11 | }, 12 | "browser_action": { 13 | "default_title": "Make this page red" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/autolink-min.js: -------------------------------------------------------------------------------- 1 | (function(){var h=[].slice;String.prototype.autoLink=function(){var b,f,d,a,e,g;a=1<=arguments.length?h.call(arguments,0):[];e=/(^|[\s\n]|)((?:https?|ftp):\/\/[\-A-Z0-9+\u0026\u2019@#\/%?=()~_|!:,.;]*[\-A-Z0-9+\u0026@#\/%=~()_|])/gi;if(!(0$2");d=a[0];f=function(){var c;c=[];for(b in d)g=d[b],"callback"!==b&&c.push(" "+b+"='"+g+"'");return c}().join("");return this.replace(e,function(c,b,a){c=("function"===typeof d.callback?d.callback(a):void 0)||""+a+"";return""+b+c})}}).call(this); 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Polydice, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------