Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

*.code-workspace
38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
“Regulated distraction.” Productivity for Chrome. https://chrome.google.com/webstore/detail/fbnpehpbojenlldmfcopeajkichnnjpo
# “Regulated distraction” for more productivity

## About

Morphine is a website blocker with a twist. It aims to reduce distraction and increase productivity. Unlike other website blockers though, nstead of allotting a certain amount of time each day for using blocked sites, Morphine gives you a "balance" to pull from, which is very slowly filled with minutes. The more you work, the more you get to play! This allows you to use your blocked sites whenever you want for as long as you want—provided you have enough time in your balance. In other words: Regulated Distraction™®!

But why take this approach? Well, let's say you're at work and have a standard website blocker turned on. A friend sends you a link to an item on one of your blocked sites, but when you try to access it, turns out you've already used all your daily allotted time up! You get pissed off and disable the plugin to "cheat" and never turn it back on. With Morphine, your wait would be no more than 10 minutes (by default), since the balance is always slowly being added to based on your desired work-life balance.


---

## Installation
Latest Version on Firefox: https://addons.mozilla.org/en-US/firefox/addon/morphine-regulated-distraction/
Legacy Version on Chrome: https://chrome.google.com/webstore/detail/fbnpehpbojenlldmfcopeajkichnnjpo
Source Code Development: https://github.com/jordanmendler/morphine


---

Wishlist:
## Wishlist (Contributions are highly appreciated):

* Pause meter. (#1)
* Manual balance cap. (#2) -- Balance can never exceed this amount
* Disabled ranges. (#4)
* Daily balance reset time. E.g. set the balance to zero at Midnight, etc 5am, etc
* Quick add current domain to block list.
* Only accrue balance during certain times of the day. E.g. during "play hours"
rather than "work hours"
* Branding: Logo and Chrome Web Store assets.
* Localization: Support and translations.
* Custom block page messages.
* Improved incognito support.
* Improved "disable" support.

Ideas:

* Pause meter. (#1)
* Manual balance cap. (#2)
* Disabled ranges. (#4)
* Daily balance reset time.
* Quick add current domain to block list.
* Only accrue balance during certain times of the day.

---

© 2016 [Teddy Cross](https://teddy.io), shared under the [MIT license](https://opensource.org/licenses/MIT).
## History

Morphine was originally written by [Teddy Cross](https://teddy.io) under the [MIT license](https://opensource.org/licenses/MIT). It has been forked by [The Veloz Group](https://www.thevelozgroup.com) and improved to support Firefox, Firefox Syncing of settings, and many more features.
23 changes: 23 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.

https://github.com/jordanmendler/morphine/
16 changes: 16 additions & 0 deletions build-firefox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

SRCDIR="$( cd "$( dirname "$0" )" && pwd )"
OUTDIR=../morphine-build

echo "src: $SRCDIR"
echo "out: $OUTDIR"

rm -rf $OUTDIR
cp -R $SRCDIR $OUTDIR
cd $OUTDIR

rm build*.sh
rm -rf .git

find . -path '*/.*' -prune -o -type f -print | zip morphine.zip -@
21 changes: 14 additions & 7 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Morphine",
"version": "1.1.0",
"version": "1.1.6",
"description": "Regulated distraction.",
"icons": {
"16": "images/icons/16.png",
Expand All @@ -16,15 +16,22 @@
"default_popup": "popup.html"
},
"background": {
"scripts": ["scripts/errors.js", "scripts/jsuri.js", "scripts/data.js", "scripts/background.js"]
"scripts": ["scripts/errors.js", "scripts/misc.js", "scripts/Uri.js", "scripts/data.js", "scripts/background.js"]
},
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
"offline_enabled": true,
"options_page": "options.html",

"content_security_policy": "script-src 'self'; object-src 'self'",

"options_ui": {
"chrome_style": false,
"page": "options.html"
},
"permissions": ["tabs"],
"web_accessible_resources": ["popup.html"]
"permissions": ["tabs","storage"],
"web_accessible_resources": ["popup.html"],

"browser_specific_settings": {
"gecko": {
"id": "{b252db54-e4f6-440f-914a-1f017a3a390d}"
}
}

}
140 changes: 140 additions & 0 deletions options-old.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Morphine options</title>
<link rel="stylesheet" href="styles/options.css">
</head>
<body>
<div class="container">
<!-- first install message -->
<div class="alert alert-success">
<p>
<strong>Welcome!</strong> Looks like you successfully installed Morphine. Thanks for checking it out!
Please take a minute to review its options below for an optimal experience, and once you've used it for a bit
consider reviewing it on the <a href="https://chrome.google.com/webstore/detail/morphine/fbnpehpbojenlldmfcopeajkichnnjpo">Chrome Web Store</a>. Have fun!
</p>
</div>


<!-- options -->
<div class="page-header">
<h2>Options</h2>
</div>

<div>
<div>
<h4>Charging</h4>
</div>
<div>
<p>Set the optimal time balance charge rate for you! With the default settings, +1 minute will be given every 10 minutes, but it can be adjusted for optimal productivity, distraction, and attention span levels.</p>
</div>

<div>
Interval <span id="charge-interval-output">&nbsp;</span><br/>
<input type="range" id="charge-interval" min="10" max="60" step="5">
</div>
<div>
Size <span id="charge-size-output">&nbsp;</span><br/>
<input type="range" id="charge-size" min="1" max="15" step="1">
</div>
</div>

<br/>

<div>
<div>
<h4>Blocking</h4>
</div>
<div>
<p>Add sites to block and (optionally) allow, one per line. Subdomains and subpaths are accepted, and if not provided will be wildcarded.</p>
<p>The allowed sites override the blocked sites and can be used to allow specific subdomains or subpaths.</p>
</div>
<div>
Blocked sites<br/>
<textarea id="target-block" rows="8"></textarea>
</div>
<div>
Allowed sites<br/>
<textarea id="target-allow" rows="8"></textarea>
</div>
</div>


<br/>

<!-- help -->
<div class="page-header">
<h2>Guide</h2>
</div>

<ul class="thumbnails">
<li>
First, add distracting sites to the blocked list.<br/>
<img src="images/tutorial/step-1.png" alt=""/>
</li>

<li>
Attempts to visit them will then be blocked. Meanwhile, the balance will slowly fill up.<br/>
<img src="images/tutorial/step-2-a.png" alt="">
<br/><br/>
<img src="images/tutorial/step-2-b.png" alt="">
</li>

<li>
Click an amount (specified in minutes) to unblock all sites for that duration. Enjoy browsing until the meter runs out :)<br/>
<img src="images/tutorial/step-3.png" alt="">
</li>
</ul>

<div>
<p>Morphine is a website blocker with a twist. Instead of allotting a certain amount of time each day for using blocked sites, Morphine gives you a "balance" to pull from, which is very slowly filled with minutes. This allows you to use your blocked sites whenever you want for as long as you want – provided you have enough time in your balance. In other words: Regulated Distraction&reg;&trade;!</p>

<p>But why take this approach? Well, let's say you're at work and have a standard website blocker turned on. A friend sends you a link to an item on one of your blocked sites, but when you try to access it, turns out you've already used all your daily allotted time up! However if you were using Morphine, your wait would be no more than 10 minutes (by default), since the balance is always slowly being added to.</p>

<p>Ready to get started? Using the balance is very easy. Once you've set the options above to your taste, click on the Morphine icon in the toolbar or try to visit a blocked site. A page with a few large buttons with numbers will be displayed – these represent minutes. Click one to add that number to the "meter". Once the meter is used up, the sites will return to being blocked.</p>
</div>


<!-- about -->
<div class="page-header">
<h2>About</h2>
</div>

<h4>Guarantee</h4>
<p>Under no circumstances will I sell, monetize, or otherwise compromise Morphine. The complete source code is publicly available on <a href="https://github.com/tkazec/morphine">GitHub</a>, shared under the <a href="https://opensource.org/licenses/MIT">MIT license</a>. Thank you. – <a href="https://teddy.io">Teddy Cross</a></p>

<h4>Contribute</h4>
<p>Morphine needs your help to improve! Are you an engineer or designer? Please check out the wishlist below, and <a href="mailto:teddy@teddy.io">get in touch</a>. If not, you can still help out by leaving a review on the <a href="https://chrome.google.com/webstore/detail/morphine/fbnpehpbojenlldmfcopeajkichnnjpo">Chrome Web Store</a>.</p>

<h4>Wishlist</h4>
<ul>
<li>Branding: Logo and Chrome Web Store assets.</li>
<li>Localization: Support and translations.</li>
<li>Custom block page messages.</li>
<li>Improved incognito support.</li>
<li>Improved "disable" support.</li>
</ul>


<!-- news -->
<div class="page-header">
<h2>News</h2>
</div>

<h4>1.1.0 <small>2016-10-17</small></h4>
<ul>
<li>Three years later...</li>
<li>Updated the options page.</li>
<li>Removed error tracking, for now.</li>
<li>Added balance and meter reset buttons.</li>
</ul>
</div>

<script src="scripts/errors.js"></script>
<script src="scripts/jquery.js"></script>
<script src="scripts/data.js"></script>
<script src="scripts/options.js"></script>
</body>
</html>
Loading