├── .gitignore ├── chrome ├── chrome.zip ├── img │ ├── icon16.png │ ├── icon19.png │ ├── icon38.png │ ├── icon48.png │ └── icon128.png ├── js │ ├── background.js │ ├── content.tpl.js │ └── content.js ├── popup.html └── manifest.json ├── package.json ├── LICENSE ├── README.md ├── lib └── deb.js └── example └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /chrome/chrome.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefanbuck/deb.js/master/chrome/chrome.zip -------------------------------------------------------------------------------- /chrome/img/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefanbuck/deb.js/master/chrome/img/icon16.png -------------------------------------------------------------------------------- /chrome/img/icon19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefanbuck/deb.js/master/chrome/img/icon19.png -------------------------------------------------------------------------------- /chrome/img/icon38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefanbuck/deb.js/master/chrome/img/icon38.png -------------------------------------------------------------------------------- /chrome/img/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefanbuck/deb.js/master/chrome/img/icon48.png -------------------------------------------------------------------------------- /chrome/img/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefanbuck/deb.js/master/chrome/img/icon128.png -------------------------------------------------------------------------------- /chrome/js/background.js: -------------------------------------------------------------------------------- 1 | chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { 2 | if(request.debjs && request.debjs && request.debjs.status === true) { 3 | chrome.browserAction.setBadgeText({ text: 'ON'}); 4 | } else { 5 | chrome.browserAction.setBadgeText({ text: '' }); 6 | } 7 | }); -------------------------------------------------------------------------------- /chrome/js/content.tpl.js: -------------------------------------------------------------------------------- 1 | if(/\bdebjs\b/.test(location.search)) { 2 | var s = document.createElement('script'); 3 | s.setAttribute('type', 'text/javascript'); 4 | s.innerHTML = '{debjs}'; 5 | var root = document.head || document.documentElement; 6 | root.insertBefore(s, root.firstChild); 7 | chrome.runtime.sendMessage({ debjs: {status: true}}, function(response) {}); 8 | } else { 9 | chrome.runtime.sendMessage({ debjs: {status: false}}, function(response) {}); 10 | } -------------------------------------------------------------------------------- /chrome/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 26 | 27 | 28 |Add debjs to your URL to get Deb.js enabled.
29 | 30 | 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "deb.js", 3 | "version": "0.0.1", 4 | "homepage": "https://github.com/krasimir/deb.js", 5 | "description": "Minimalistic JavaScript library for debugging in the browser", 6 | "author": { 7 | "name": "Krasimir Tsonev", 8 | "email": "info@krasimirtsonev.com", 9 | "url": "http://krasimirtsonev.com" 10 | }, 11 | "license": "MIT", 12 | "dependencies": { 13 | 14 | }, 15 | "devDependencies": { 16 | "uglify-js": "2.4.14" 17 | }, 18 | "keywords": [ 19 | "javascript", 20 | "browser", 21 | "debugger" 22 | ], 23 | "repository": { 24 | "type": "git", 25 | "url": "https://github.com/krasimir/deb.js" 26 | }, 27 | "scripts": { 28 | "build": "node ./build.js" 29 | } 30 | } -------------------------------------------------------------------------------- /chrome/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Deb.js", 4 | "description": "The tiniest debugger in the world", 5 | "version": "0.0.3", 6 | "icons": { "16": "img/icon16.png", "48": "img/icon48.png", "128": "img/icon128.png" }, 7 | "browser_action": { 8 | "default_icon": { 9 | "19": "img/icon19.png", 10 | "38": "img/icon38.png" 11 | }, 12 | "default_title": "Deb.js", 13 | "default_popup": "popup.html" 14 | }, 15 | "permissions": [ 16 | "activeTab", "tabs", "storage" 17 | ], 18 | "background": { 19 | "scripts": ["js/background.js"], 20 | "persistent": false 21 | }, 22 | "content_scripts": [ 23 | { 24 | "matches": ["http://*/*", "https://*/*"], 25 | "js": ["js/content.js"], 26 | "run_at": "document_start" 27 | } 28 | ], 29 | "web_accessible_resources": [ 30 | "js/deb.min.js" 31 | ] 32 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Krasimir Tsonev 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. -------------------------------------------------------------------------------- /chrome/js/content.js: -------------------------------------------------------------------------------- 1 | if(/\bdebjs\b/.test(location.search)) { 2 | var s = document.createElement('script'); 3 | s.setAttribute('type', 'text/javascript'); 4 | s.innerHTML = '!function(o,n){"function"==typeof define&&define.amd?define([],n):n()}(this,function(){Function.prototype.debc=function(o){return Function.prototype.deb.apply(this,[o,!0])},Function.prototype.deb=function(o,n){var t,e=function(){return"rgb("+(Math.floor(76*Math.random())+200)+","+(Math.floor(76*Math.random())+200)+","+(Math.floor(76*Math.random())+200)+")"},r=function(o,e,r){"undefined"!=typeof console&&(l&&"string"==typeof o?r!==!1&&o.indexOf("%20")<0?console[e?n?"groupCollapsed":"group":"log"]("%c"+o,"background:"+t+";"+r):console[e?n?"groupCollapsed":"group":"log"](o):console[e?"group":"log"](o))},i=function(){"undefined"!=typeof console&&console.groupEnd()},c=function(n,t,e){var c=e.toString().match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[0];if(0===n[0].indexOf("Error")&&(n=n.slice(1)),r(o+c+")",a),t&&t.length>0){r("arguments:",!0);for(var u=0;u