Skip to content

Commit

Permalink
Merge pull request #3 from scottrigby/moz
Browse files Browse the repository at this point in the history
Firefox support
  • Loading branch information
scottrigby authored Sep 19, 2018
2 parents 668de15 + 4d6e1ba commit 8f2c7e8
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# DCO GitHub UI

This Chrome extension adds DCO Signed-off-by line to commits made with the GitHub browser UI.
This browser extension adds DCO Signed-off-by line to commits made with the GitHub browser UI.

## Install

### Chrome

In the Chrome web store [search for "dco"](https://chrome.google.com/webstore/search/dco), or go to [the extension page](https://chrome.google.com/webstore/detail/dco-github-ui/onhgmjhnaeipfgacbglaphlmllkpoijo), and click "Add to Chrome":

![options screenshot](images/screenshot-webstore.png)
![Chrome webstore screenshot](images/screenshot-chrome-webstore.png)

### Firefox

In Firefox Add-ons, [search for "dco"](https://addons.mozilla.org/en-US/firefox/search/?q=dco), or go to [the extension page](https://addons.mozilla.org/en-US/firefox/addon/scott-rigby/), and click "+ Add to Firefox":

![Firefox add-ons screenshot](images/screenshot-firefox-addons.png)

## Configure

Expand Down
7 changes: 6 additions & 1 deletion content.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
chrome.storage.sync.get({
// Note we use a content script instead of a background script because:
// > Background scripts can access all the WebExtension JavaScript APIs, but
// they can't directly access the content of web pages. So if your extension
// needs to do that, you need content scripts.
// See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts
chrome.storage.local.get({
signoff: ''
}, function (items) {
document.getElementById('commit-description-textarea').value = items.signoff;
Expand Down
Binary file added images/dco-gh-ui-96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added images/screenshot-firefox-addons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "DCO GitHub UI",
"version": "0.2.0",
"version": "0.3.0",
"description": "DCO signoff for GitHub UI",
"options_ui": {
"page": "options.html",
Expand All @@ -14,6 +14,7 @@
"16": "images/dco-gh-ui-16.png",
"32": "images/dco-gh-ui-32.png",
"48": "images/dco-gh-ui-48.png",
"96": "images/dco-gh-ui-96.png",
"128": "images/dco-gh-ui-128.png"
},
"content_scripts": [
Expand Down
4 changes: 2 additions & 2 deletions options.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Saves options to chrome.storage
function save_options() {
var signoff = document.getElementById('signoff').value;
chrome.storage.sync.set({
chrome.storage.local.set({
signoff: signoff
}, function () {
// Update status to let user know options were saved.
Expand All @@ -16,7 +16,7 @@ function save_options() {
// Restores select box and checkbox state using the preferences
// stored in chrome.storage.
function restore_options() {
chrome.storage.sync.get({
chrome.storage.local.get({
signoff: ''
}, function (items) {
document.getElementById('signoff').value = items.signoff;
Expand Down

0 comments on commit 8f2c7e8

Please sign in to comment.