├── .gitattributes ├── .babelrc ├── app ├── styles │ └── main.css ├── scripts │ ├── ipc.js │ ├── chromereload.js │ ├── websitemanager.js │ ├── proxy.js │ └── background.js ├── images │ ├── icon.png │ ├── icon-16.png │ ├── icon-19.png │ ├── icon-38.png │ ├── icon-128.png │ └── icon-disabled.png ├── _locales │ └── en │ │ └── messages.json └── manifest.json ├── .bowerrc ├── .gitignore ├── bower.json ├── test ├── spec │ └── test.js └── index.html ├── webpack.config.js ├── package.json └── gulpfile.babel.js /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"] 3 | } 4 | -------------------------------------------------------------------------------- /app/styles/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "app/bower_components" 3 | } 4 | -------------------------------------------------------------------------------- /app/scripts/ipc.js: -------------------------------------------------------------------------------- 1 | 2 | export class IPCManager { 3 | constructor() { 4 | 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /app/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CacheBrowser/cachebrowser-chrome/HEAD/app/images/icon.png -------------------------------------------------------------------------------- /app/images/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CacheBrowser/cachebrowser-chrome/HEAD/app/images/icon-16.png -------------------------------------------------------------------------------- /app/images/icon-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CacheBrowser/cachebrowser-chrome/HEAD/app/images/icon-19.png -------------------------------------------------------------------------------- /app/images/icon-38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CacheBrowser/cachebrowser-chrome/HEAD/app/images/icon-38.png -------------------------------------------------------------------------------- /app/images/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CacheBrowser/cachebrowser-chrome/HEAD/app/images/icon-128.png -------------------------------------------------------------------------------- /app/images/icon-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CacheBrowser/cachebrowser-chrome/HEAD/app/images/icon-disabled.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | temp 3 | .tmp 4 | dist 5 | .sass-cache 6 | app/bower_components 7 | test/bower_components 8 | package 9 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cachebrowser", 3 | "private": true, 4 | "version": "0.0.0", 5 | "dependencies": {}, 6 | "devDependencies": { 7 | "chai": "^3.5.0", 8 | "mocha": "^2.5.3" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/spec/test.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 'use strict'; 3 | 4 | describe('Give it some context', function () { 5 | describe('maybe a bit more context here', function () { 6 | it('should run here few assertions', function () { 7 | 8 | }); 9 | }); 10 | }); 11 | })(); 12 | -------------------------------------------------------------------------------- /app/_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName": { 3 | "message": "CacheBrowser", 4 | "description": "The name of the application" 5 | }, 6 | "appDescription": { 7 | "message": "CacheBrowser Chrome Extension", 8 | "description": "The description of the application" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var webpack = require('webpack'); 3 | 4 | module.exports = { 5 | entry: [ 6 | // 'babel-polyfill', 7 | './app/scripts/background.js' 8 | ], 9 | output: { 10 | filename: 'background.js' 11 | }, 12 | devtool: 'source-map', 13 | module: { 14 | loaders: [ 15 | { 16 | loader: "babel-loader", 17 | query: { 18 | // plugins: ['transform-runtime'], 19 | presets: ['es2015'], 20 | } 21 | }, 22 | ] 23 | }, 24 | debug: true 25 | }; 26 | -------------------------------------------------------------------------------- /app/scripts/chromereload.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Reload client for Chrome Apps & Extensions. 4 | // The reload client has a compatibility with livereload. 5 | // WARNING: only supports reload command. 6 | 7 | const LIVERELOAD_HOST = 'localhost:'; 8 | const LIVERELOAD_PORT = 35729; 9 | const connection = new WebSocket('ws://' + LIVERELOAD_HOST + LIVERELOAD_PORT + '/livereload'); 10 | 11 | connection.onerror = error => { 12 | console.log('reload connection got error:', error); 13 | }; 14 | 15 | connection.onmessage = e => { 16 | if (e.data) { 17 | const data = JSON.parse(e.data); 18 | if (data && data.command === 'reload') { 19 | chrome.runtime.reload(); 20 | } 21 | } 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /app/scripts/websitemanager.js: -------------------------------------------------------------------------------- 1 | 2 | export class WebsiteManager { 3 | constructor(ipc) { 4 | this.ipc = ipc; 5 | 6 | this.activeWebsites = new Set(); 7 | } 8 | 9 | websiteFromUrl(url) { 10 | var url = new URL(url); 11 | return url.hostname; 12 | } 13 | 14 | isWebsiteActive(website) { 15 | return this.activeWebsites.has(website); 16 | } 17 | 18 | toggleWebsite(website) { 19 | if (this.activeWebsites.has(website)) { 20 | this.activeWebsites.delete(website); 21 | return false; 22 | } else { 23 | this.activeWebsites.add(website); 24 | return true; 25 | } 26 | } 27 | 28 | getActiveWebsites() { 29 | return Array.from(this.activeWebsites); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "__MSG_appName__", 3 | "version": "0.0.1", 4 | "manifest_version": 2, 5 | "description": "__MSG_appDescription__", 6 | "icons": { 7 | "16": "images/icon.png", 8 | "128": "images/icon.png" 9 | }, 10 | "default_locale": "en", 11 | "background": { 12 | "scripts": [ 13 | "scripts/background.js" 14 | ] 15 | }, 16 | "permissions": [ 17 | "http://*/*", 18 | "https://*/*", 19 | "background", 20 | "webRequest", 21 | "*://*.google.com/", 22 | "webRequestBlocking", 23 | "tabs", 24 | "proxy" 25 | ], 26 | "options_ui": { 27 | "page": "options.html", 28 | "chrome_style": true 29 | }, 30 | "page_action": { 31 | "default_icon": { 32 | "19": "images/icon.png", 33 | "38": "images/icon.png" 34 | }, 35 | "default_title": "CacheBrowser" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |