From d9a90e5e805673a31ce9dfa0d5928f03f23af37f Mon Sep 17 00:00:00 2001 From: Dave R Date: Sun, 9 Sep 2018 16:18:25 +0100 Subject: [PATCH] new!! --- README.md | 30 +++++++++++++++++++++------- assets/css/index.css | 5 ++--- assets/js/background-opera.js | 17 ++++++++++++++++ assets/js/index.js | 8 ++++++-- manifest-chrome.json | 12 +++++++++++ manifest.json => manifest-opera.json | 25 +++++++++++++---------- 6 files changed, 74 insertions(+), 23 deletions(-) create mode 100644 assets/js/background-opera.js create mode 100644 manifest-chrome.json rename manifest.json => manifest-opera.json (57%) diff --git a/README.md b/README.md index d2989d2a..3f7269b0 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,35 @@ # Mue -Fast, open and free-to-use new tab page for Chrome (also works on Firefox) +Fast, open and free-to-use new tab page for Chrome (also works on Opera and Firefox) ## Installation ### Chrome -1. ``git clone https://github.com/ohlookitsderpy/Mue`` -2. Visit ``chrome://extensions`` in your browser -3. Click **Load unpacked** (Make sure **Developer Mode** is on) -4. Go to the directory, and click ok -5. Enjoy your new tab! +1. ``git clone https://github.com/ohlookitsderpy/Mue`` (if you don't have git just go to **Clone or download** and click **Download ZIP**) +2. Rename ``manifest-chrome.json`` to ``manifest.json`` +3. Visit ``chrome://extensions`` in your browser +4. Click **Load unpacked** (Make sure **Developer Mode** is on) +5. Go to the directory and click ok +6. Enjoy your new tab! +### Opera +1. ``git clone https://github.com/ohlookitsderpy/Mue`` (if you don't have git just go to **Clone or download** and click **Download ZIP**) +2. Rename ``manifest-opera.json`` to ``manifest.json`` +3. Visit ``about://extensions`` in your browser +4. Click **Load unpacked extension...** (Make sure you are in **Developer Mode**) +5. Go to the directory and click ok +6. Enjoy your new tab! ### Firefox -soon TM +*Note: I'm currently trying to find a better method to do this, but this works for now. Also in testing and may not work properly!* +1. ``git clone https://github.com/ohlookitsderpy/Mue`` (if you don't have git just go to **Clone or download** and click **Download ZIP**) +2. Rename ``manifest-chrome`` to ``manifest.json`` +3. Visit ``about:debugging#addons`` in your browser +4. Click **Load temporary Add-on** +5. Go to the directory and click on the manifest.json +6. Enjoy your new tab! ## Credits [Turbomarshmello](https://github.com/TurboMarshmello) - Portions of original code, name idea. ~~pls don't ban me i gave credit~~ [Pexels](https://pexels.com) - Stock photos used +[Opera Forum](https://forums.opera.com/topic/25046/how-to-disable-completely-the-speed-dial/14) - Portions of code to add Opera support + and all the contributors <3 diff --git a/assets/css/index.css b/assets/css/index.css index 04169978..205b2b0b 100644 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -113,11 +113,10 @@ time { /* Font */ -/* roboto-regular - latin */ @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), - url('../font/roboto-v18-latin-regular.woff2') format('woff2'); /* Super Modern Browsers */ - } + url('../font/roboto-v18-latin-regular.woff2') format('woff2'); + } \ No newline at end of file diff --git a/assets/js/background-opera.js b/assets/js/background-opera.js new file mode 100644 index 00000000..348e4cba --- /dev/null +++ b/assets/js/background-opera.js @@ -0,0 +1,17 @@ +// Original code sourced from https://forums.opera.com/topic/25046/how-to-disable-completely-the-speed-dial/14 + +chrome.tabs.onCreated.addListener(function(tab) { + if (tab.status === "complete" && tab.url === "chrome://startpage/") { + chrome.tabs.update(tab.id, { + url: chrome.extension.getURL("index.html") + }); + } +}); + +chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { + if (changeInfo.status === "complete" && tab.url === "chrome://startpage/") { + chrome.tabs.update(tabId, { + url: chrome.extension.getURL("index.html") + }); + } +}); \ No newline at end of file diff --git a/assets/js/index.js b/assets/js/index.js index 9dc122c1..bf38f760 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -121,8 +121,12 @@ function setRandomQuote () { { text: 'Hard times don’t create heroes. It is during the hard times when the ‘hero’ within us is revealed.', author: 'Bob Riley'}, { text: 'If you can tune into your purpose and really align with it, setting goals so that your vision is an expression of that purpose, then life flows much more easily.', author: 'Jack Canfield'}, { text: 'Whatever the mind can conceive and believe, it can achieve.', author: 'Napoleon Hill'}, - { text: 'Don’t wish it were easier. Wish you were better.', author: 'Jim Rohn'} - + { text: 'Don’t wish it were easier. Wish you were better.', author: 'Jim Rohn'}, + { text: 'A champion is defined not by their wins but by how they can recover when they fall.', author: 'Serena Williams'}, + { text: 'Motivation comes from working on things we care about.', author: 'Sheryl Sandberg'}, + { text: 'With the right kind of coaching and determination you can accomplish anything.', author: 'Reese Witherspoon'}, + { text: 'Some people look for a beautiful place. Others make a place beautiful.', author: 'Hazrat Inayat Khan'}, + { text: 'Life is like riding a bicycle. To keep your balance, you must keep moving.', author: 'Albert Einstein'} ], quote = pickFromArray(quotes); diff --git a/manifest-chrome.json b/manifest-chrome.json new file mode 100644 index 00000000..7c203a85 --- /dev/null +++ b/manifest-chrome.json @@ -0,0 +1,12 @@ +{ + "manifest_version": 2, + "name": "Mue", + "version": "0.1", + "browser_action": { + "default_icon": "./assets/img/icon.png" + }, + "chrome_url_overrides" : { + "newtab": "index.html" + } +} + \ No newline at end of file diff --git a/manifest.json b/manifest-opera.json similarity index 57% rename from manifest.json rename to manifest-opera.json index 65a99787..ce4a136a 100644 --- a/manifest.json +++ b/manifest-opera.json @@ -1,11 +1,14 @@ -{ - "manifest_version": 2, - "name": "Mue", - "version": "0.1", - "browser_action": { - "default_icon": "./assets/img/icon.png" - }, -"chrome_url_overrides" : { - "newtab": "index.html" - } -} +{ + "manifest_version": 2, + "name": "Mue", + "version": "0.1", + "browser_action": { + "default_icon": "./assets/img/icon.png" + }, + "background": { + "scripts": ["./assets/js/background-opera.js"] + }, +"permissions": [ + "tabs" + ] +}