Last active
May 1, 2024 19:48
-
-
Save kennycoder/03cb7d47f60c9edc71febdf08ee1a9a1 to your computer and use it in GitHub Desktop.
Markdown Here patch for Thunderbird 78+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: Nikolai Danylchyk | |
Date: Sun, 28 Mar 2021 18:32:05 +0200 | |
Subject: [PATCH] updated for tb78+ | |
--- | |
src/chrome/backgroundscript.js | 38 +++++-- | |
src/common/markdown-here.js | 2 +- | |
src/common/options-iframe.js | 2 - | |
src/common/options-store.js | 121 +---------------------- | |
src/common/options.js | 10 -- | |
src/common/utils.js | 175 ++------------------------------- | |
src/manifest-browser.json | 52 ++++++++++ | |
src/manifest-thunderbird.json | 39 ++++++++ | |
src/manifest.json | 91 ++++++++--------- | |
9 files changed, 172 insertions(+), 358 deletions(-) | |
create mode 100644 src/manifest-browser.json | |
create mode 100755 src/manifest-thunderbird.json | |
mode change 100644 => 100755 src/manifest.json | |
diff --git a/src/chrome/backgroundscript.js b/src/chrome/backgroundscript.js | |
index 9c1c437..347bb73 100644 | |
--- a/src/chrome/backgroundscript.js | |
+++ b/src/chrome/backgroundscript.js | |
@@ -51,6 +51,10 @@ function upgradeCheck() { | |
}); | |
} | |
+let actionButton | |
+ | |
+if (messenger === undefined) { | |
+ // Running in a browser such as Firefox, Chrome, Safari | |
// Create the context menu that will signal our main code. | |
chrome.contextMenus.create({ | |
contexts: ['editable'], | |
@@ -59,6 +63,11 @@ chrome.contextMenus.create({ | |
chrome.tabs.sendMessage(tab.id, {action: 'context-click'}); | |
} | |
}); | |
+ actionButton = chrome.browserAction | |
+} else { | |
+ // Running in a Thunderbird compose window | |
+ actionButton = messenger.composeAction | |
+} | |
// Handle rendering requests from the content script. | |
// See the comment in markdown-render.js for why we do this. | |
@@ -89,11 +98,11 @@ chrome.runtime.onMessage.addListener(function(request, sender, responseCallback) | |
} | |
else if (request.action === 'show-toggle-button') { | |
if (request.show) { | |
- chrome.browserAction.enable(sender.tab.id); | |
- chrome.browserAction.setTitle({ | |
+ actionButton.enable(sender.tab.id); | |
+ actionButton.setTitle({ | |
title: Utils.getMessage('toggle_button_tooltip'), | |
tabId: sender.tab.id }); | |
- chrome.browserAction.setIcon({ | |
+ actionButton.setIcon({ | |
path: { | |
"16": Utils.getLocalURL('/common/images/icon16-button-monochrome.png'), | |
"19": Utils.getLocalURL('/common/images/icon19-button-monochrome.png'), | |
@@ -105,11 +114,11 @@ chrome.runtime.onMessage.addListener(function(request, sender, responseCallback) | |
return false; | |
} | |
else { | |
- chrome.browserAction.disable(sender.tab.id); | |
- chrome.browserAction.setTitle({ | |
+ actionButton.disable(sender.tab.id); | |
+ actionButton.setTitle({ | |
title: Utils.getMessage('toggle_button_tooltip_disabled'), | |
tabId: sender.tab.id }); | |
- chrome.browserAction.setIcon({ | |
+ actionButton.setIcon({ | |
path: { | |
"16": Utils.getLocalURL('/common/images/icon16-button-disabled.png'), | |
"19": Utils.getLocalURL('/common/images/icon19-button-disabled.png'), | |
@@ -148,10 +157,25 @@ chrome.runtime.onMessage.addListener(function(request, sender, responseCallback) | |
}); | |
// Add the browserAction (the button in the browser toolbar) listener. | |
-chrome.browserAction.onClicked.addListener(function(tab) { | |
+actionButton.onClicked.addListener(function(tab) { | |
chrome.tabs.sendMessage(tab.id, {action: 'button-click', }); | |
}); | |
+if (messenger !== undefined) { | |
+ // Mail Extensions are not able to add composeScripts via manifest.json, | |
+ // they must be added via the API. | |
+ messenger.composeScripts.register({ | |
+ "js": [ | |
+ {file: "../common/utils.js"}, | |
+ {file: "../common/common-logic.js"}, | |
+ {file: "../common/jsHtmlToText.js"}, | |
+ {file: "../common/marked.js"}, | |
+ {file: "../common/mdh-html-to-text.js"}, | |
+ {file: "../common/markdown-here.js"}, | |
+ {file: "contentscript.js"} | |
+ ] | |
+ }); | |
+} | |
/* | |
Showing an notification after upgrade is complicated by the fact that the | |
diff --git a/src/common/markdown-here.js b/src/common/markdown-here.js | |
index 41955dd..ce76fe9 100644 | |
--- a/src/common/markdown-here.js | |
+++ b/src/common/markdown-here.js | |
@@ -432,7 +432,7 @@ function findMarkdownHereWrapper(focusedElem) { | |
function findMarkdownHereWrappersInRange(range) { | |
// Adapted from: http://stackoverflow.com/a/1483487/729729 | |
var containerElement = range.commonAncestorContainer; | |
- if (containerElement.nodeType != containerElement.ELEMENT_NODE) { | |
+ if (containerElement.nodeType !== containerElement.ELEMENT_NODE) { | |
containerElement = containerElement.parentNode; | |
} | |
diff --git a/src/common/options-iframe.js b/src/common/options-iframe.js | |
index 83ebc48..856c905 100644 | |
--- a/src/common/options-iframe.js | |
+++ b/src/common/options-iframe.js | |
@@ -4,7 +4,6 @@ | |
*/ | |
function onLoad() { | |
- /*? if(platform==='safari' || platform==='chrome' || platform==='firefox'){ */ | |
// Chrome/Safari/WebExtensions require us to manually load our content script in order | |
// to use the button and context menu in the iframe. | |
if (typeof(safari) !== 'undefined' || typeof(chrome) !== 'undefined') { | |
@@ -18,7 +17,6 @@ function onLoad() { | |
} | |
document.body.appendChild(contentscript); | |
} | |
- /*? } */ | |
// The body of the iframe needs to have a (collapsed) selection range for | |
// Markdown Here to work (simulating focus/cursor). | |
diff --git a/src/common/options-store.js b/src/common/options-store.js | |
index 1df85b0..7591648 100644 | |
--- a/src/common/options-store.js | |
+++ b/src/common/options-store.js | |
@@ -25,7 +25,6 @@ var DEFAULTS = { | |
'gfm-line-breaks-enabled': true | |
}; | |
-/*? if(platform!=='thunderbird'){ */ | |
/* | |
* Chrome storage helper. Gets around the synchronized value size limit. | |
* Overall quota limits still apply (or less, but we should stay well within). | |
@@ -259,113 +258,6 @@ var ChromeOptionsStore = { | |
}); | |
} | |
}; | |
-/*? } */ | |
- | |
-/*? if(platform==='thunderbird'){ */ | |
-/* | |
- * Mozilla preferences storage helper | |
- */ | |
- | |
-var MozillaOptionsStore = { | |
- | |
- get: function(callback) { | |
- var that = this; | |
- this._sendRequest({verb: 'get'}, function(prefsObj) { | |
- that._fillDefaults(prefsObj, callback); | |
- }); | |
- }, | |
- | |
- set: function(obj, callback) { | |
- this._sendRequest({verb: 'set', obj: obj}, callback); | |
- }, | |
- | |
- remove: function(arrayOfKeys, callback) { | |
- this._sendRequest({verb: 'clear', obj: arrayOfKeys}, callback); | |
- }, | |
- | |
- // The default values or URLs for our various options. | |
- defaults: { | |
- 'local-first-run': true, | |
- 'main-css': {'__defaultFromFile__': 'resource://markdown_here_common/default.css', '__mimeType__': 'text/css'}, | |
- 'syntax-css': {'__defaultFromFile__': 'resource://markdown_here_common/highlightjs/styles/github.css', '__mimeType__': 'text/css'}, | |
- 'math-enabled': DEFAULTS['math-enabled'], | |
- 'math-value': DEFAULTS['math-value'], | |
- 'hotkey': DEFAULTS['hotkey'], | |
- 'forgot-to-render-check-enabled': DEFAULTS['forgot-to-render-check-enabled'], | |
- 'header-anchors-enabled': DEFAULTS['header-anchors-enabled'], | |
- 'gfm-line-breaks-enabled': DEFAULTS['gfm-line-breaks-enabled'] | |
- }, | |
- | |
- // This is called both from content and background scripts, and we need vastly | |
- // different code in those cases. When calling from a content script, we need | |
- // to make a request to a background service (found in firefox/chrome/content/background-services.js). | |
- // When called from a background script, we're going to access the browser prefs | |
- // directly. Unfortunately, this means duplicating some code from the background | |
- // service. | |
- _sendRequest: function(data, callback) { // analogue of chrome.runtime.sendMessage | |
- var privileged, prefsBranch, prefKeys, prefsObj, i; | |
- | |
- privileged = (typeof(Components) !== 'undefined' && typeof(Components.classes) !== 'undefined'); | |
- if (!privileged) { | |
- // This means that this code is being called from a content script. | |
- // We need to send a request from this non-privileged context to the | |
- // privileged background script. | |
- data.action = 'prefs-access'; | |
- Utils.makeRequestToPrivilegedScript( | |
- document, | |
- data, | |
- callback); | |
- | |
- return; | |
- } | |
- | |
- prefsBranch = Components.classes['@mozilla.org/preferences-service;1'] | |
- .getService(Components.interfaces.nsIPrefService) | |
- .getBranch('extensions.markdown-here.'); | |
- | |
- if (data.verb === 'get') { | |
- prefKeys = prefsBranch.getChildList(''); | |
- prefsObj = {}; | |
- | |
- for (i = 0; i < prefKeys.length; i++) { | |
- // All of our legitimate prefs should be strings, but issue #237 suggests | |
- // that things may sometimes get into a bad state. We will check and delete | |
- // and prefs that aren't strings. | |
- // https://github.com/adam-p/markdown-here/issues/237 | |
- if (prefsBranch.getPrefType(prefKeys[i]) !== prefsBranch.PREF_STRING) { | |
- prefsBranch.clearUserPref(prefKeys[i]); | |
- continue; | |
- } | |
- | |
- prefsObj[prefKeys[i]] = Utils.getMozJsonPref(prefsBranch, prefKeys[i]); | |
- } | |
- | |
- callback(prefsObj); | |
- return; | |
- } | |
- else if (data.verb === 'set') { | |
- for (i in data.obj) { | |
- Utils.setMozJsonPref(prefsBranch, i, data.obj[i]); | |
- } | |
- | |
- if (callback) callback(); | |
- return; | |
- } | |
- else if (data.verb === 'clear') { | |
- if (typeof(data.obj) === 'string') { | |
- data.obj = [data.obj]; | |
- } | |
- | |
- for (i = 0; i < data.obj.length; i++) { | |
- prefsBranch.clearUserPref(data.obj[i]); | |
- } | |
- | |
- if (callback) return callback(); | |
- return; | |
- } | |
- } | |
-}; | |
-/*? } */ | |
/*? if(platform==='safari'){ */ | |
@@ -476,11 +368,12 @@ var SafariOptionsStore = { | |
// Choose which OptionsStore engine we should use. | |
// (This if-structure is ugly to work around the preprocessor logic.) | |
-/*? if(platform==='chrome' || platform==='firefox'){ */ | |
+/*? if(platform==='chrome' || platform==='firefox' || platform==='thunderbird'){ */ | |
if (typeof(navigator) !== 'undefined' | |
&& (navigator.userAgent.indexOf('Chrome') >= 0 | |
- || navigator.userAgent.indexOf('Firefox') >= 0)) { | |
- this.OptionsStore = ChromeOptionsStore; | |
+ || navigator.userAgent.indexOf('Firefox') >= 0 | |
+ || navigator.userAgent.indexOf('Thunderbird') >= 0)){ | |
+ this.OptionsStore = ChromeOptionsStore; | |
} | |
/*? } */ | |
/*? if(platform==='safari'){ */ | |
@@ -490,12 +383,6 @@ if (!this.OptionsStore | |
this.OptionsStore = SafariOptionsStore; | |
} | |
/*? } */ | |
-/*? if(platform==='thunderbird'){ */ | |
-// Thunderbird, Postbox, Icedove | |
-if (!this.OptionsStore) { | |
- this.OptionsStore = MozillaOptionsStore; | |
-} | |
-/*? } */ | |
this.OptionsStore._fillDefaults = function(prefsObj, callback) { | |
var that = this; | |
diff --git a/src/common/options.js b/src/common/options.js | |
index 05e9e92..c47dd93 100644 | |
--- a/src/common/options.js | |
+++ b/src/common/options.js | |
@@ -128,16 +128,6 @@ function onLoad() { | |
} | |
}); | |
- // Older Thunderbird may try to open this options page in a new ChromeWindow, and it | |
- // won't work. So in that case we need to tell the user how they can actually open the | |
- // options page. This is pretty ungraceful, but few users will encouter it, and fewer as | |
- // time goes on. | |
- setTimeout(function() { | |
- if (!optionsGetSuccessful) { | |
- alert('It looks like you are running an older version of Thunderird.\nOpen the Markdown Here Options via the message window Tools menu.'); | |
- window.close(); | |
- } | |
- }, 500); | |
loaded = true; | |
} | |
diff --git a/src/common/utils.js b/src/common/utils.js | |
index 46dae09..6cb8965 100644 | |
--- a/src/common/utils.js | |
+++ b/src/common/utils.js | |
@@ -180,7 +180,7 @@ function getSelectedElementsInRange(range) { | |
if (range) { | |
containerElement = range.commonAncestorContainer; | |
- if (containerElement.nodeType != 1) { | |
+ if (containerElement.nodeType !== 1) { | |
containerElement = containerElement.parentNode; | |
} | |
@@ -300,7 +300,7 @@ function getLocalURL(url) { | |
// (This if-structure is ugly to work around the preprocessor logic.) | |
var matched = false; | |
- /*? if (platform==='chrome' || platform==='firefox') { */ | |
+ /*? if (platform==='chrome' || platform==='firefox' || platform==='thunderbird') { */ | |
if (typeof(chrome) !== 'undefined') { | |
matched = true; | |
return chrome.extension.getURL(url); | |
@@ -458,7 +458,7 @@ var PRIVILEGED_REQUEST_EVENT_NAME = 'markdown-here-request-event'; | |
function makeRequestToPrivilegedScript(doc, requestObj, callback) { | |
// (This if-structure is ugly to work around the preprocessor logic.) | |
var matched = false; | |
- /*? if(platform==='chrome' || platform==='firefox'){ */ | |
+ /*? if(platform==='chrome' || platform==='firefox' || platform==='thunderbird'){ */ | |
if (typeof(chrome) !== 'undefined') { | |
matched = true; | |
// If `callback` is undefined and we pass it anyway, Chrome complains with this: | |
@@ -516,41 +516,6 @@ function makeRequestToPrivilegedScript(doc, requestObj, callback) { | |
safari.self.tab.dispatchMessage('request', window.JSON.stringify(requestObj)); | |
} | |
/*? } */ | |
- /*? if(platform==='thunderbird'){ */ | |
- if (!matched) { // Mozilla/XUL | |
- matched = true; | |
- | |
- // See: https://developer.mozilla.org/en-US/docs/Code_snippets/Interaction_between_privileged_and_non-privileged_pages#Chromium-like_messaging.3A_json_request_with_json_callback | |
- | |
- // Make a unique event name to use. (Bad style to modify the input like this...) | |
- requestObj.responseEventName = 'markdown-here-response-event-' + Math.floor(Math.random()*1000000); | |
- | |
- var request = doc.createTextNode(JSON.stringify(requestObj)); | |
- | |
- var responseHandler = function(event) { | |
- var response = null; | |
- | |
- // There may be no response data. | |
- if (request.nodeValue) { | |
- response = JSON.parse(request.nodeValue); | |
- } | |
- | |
- request.parentNode.removeChild(request); | |
- | |
- if (callback) { | |
- callback(response); | |
- } | |
- }; | |
- | |
- request.addEventListener(requestObj.responseEventName, responseHandler, false); | |
- | |
- (doc.head || doc.body).appendChild(request); | |
- | |
- var event = doc.createEvent('HTMLEvents'); | |
- event.initEvent(PRIVILEGED_REQUEST_EVENT_NAME, true, false); | |
- request.dispatchEvent(event); | |
- } | |
- /*? } */ | |
} | |
@@ -659,86 +624,6 @@ function nextTickFn(callback, context) { | |
} | |
-/*? if(platform==='thunderbird'){ */ | |
- | |
-/** | |
- * Returns the stored preference string for the given key. | |
- * Must only be called from a privileged Mozilla script. | |
- * @param {nsIPrefBranch} prefsBranch | |
- * @param {string} key | |
- * @returns {?string} The preference value. May be null if the preference is not set | |
- * or is null. | |
- */ | |
-function getMozStringPref(prefsBranch, key) { | |
- try { | |
- if (Services.vc.compare(Services.appinfo.platformVersion, '58') < 0) { | |
- return prefsBranch.getComplexValue( | |
- key, | |
- Components.interfaces.nsISupportsString).data; | |
- } | |
- | |
- return prefsBranch.getStringPref(key, null); | |
- } | |
- catch(e) { | |
- // getComplexValue could have thrown an exception because it didn't find the key. As | |
- // with getStringPref, we will default to null. | |
- return null; | |
- } | |
-} | |
- | |
-/** | |
- * Get the stored preference object, JSON-parsed, for the given key. | |
- * Must only be called from a privileged Mozilla script. | |
- * @param {nsIPrefBranch} prefsBranch | |
- * @param {string} key | |
- * @returns {?(object|number|boolean|string)} The preference object (any valid JSON | |
- * type). May be null if the preference is not set or is null. | |
- */ | |
-function getMozJsonPref(prefsBranch, key) { | |
- try { | |
- return JSON.parse(getMozStringPref(prefsBranch, key)); | |
- } | |
- catch(e) { | |
- return null; | |
- } | |
-} | |
- | |
-/** | |
- * Store the preference string for the given key. | |
- * Must only be called from a privileged Mozilla script. | |
- * @param {nsIPrefBranch} prefsBranch | |
- * @param {string} key | |
- * @param {string} value | |
- */ | |
-function setMozStringPref(prefsBranch, key, value) { | |
- var supportString = Components.classes['@mozilla.org/supports-string;1'] | |
- .createInstance(Components.interfaces.nsISupportsString); | |
- | |
- if (Services.vc.compare(Services.appinfo.platformVersion, '58') < 0) { | |
- supportString.data = value; | |
- prefsBranch.setComplexValue( | |
- key, | |
- Components.interfaces.nsISupportsString, | |
- supportString); | |
- } | |
- else { | |
- prefsBranch.setStringPref(key, value); | |
- } | |
-} | |
- | |
-/** | |
- * Store the given object in preferences under the given key. | |
- * Must only be called from a privileged Mozilla script. | |
- * @param {nsIPrefBranch} prefsBranch | |
- * @param {string} key | |
- * @param {?(object|number|boolean|string)} value | |
- */ | |
-function setMozJsonPref(prefsBranch, key, value) { | |
- setMozStringPref(prefsBranch, key, JSON.stringify(value)); | |
-} | |
- | |
-/*? } */ | |
- | |
/* | |
* i18n/l10n | |
@@ -776,7 +661,7 @@ var g_stringBundleLoadListeners = []; | |
function registerStringBundleLoadListener(callback) { | |
// (This if-structure is ugly to work around the preprocessor logic.) | |
var matched = false; | |
- /*? if(platform==='chrome' || platform==='firefox'){ */ | |
+ /*? if(platform==='chrome' || platform==='firefox' || platform==='thunderbird'){ */ | |
if (typeof(chrome) !== 'undefined') { | |
matched = true; | |
// Already loaded | |
@@ -794,16 +679,6 @@ function registerStringBundleLoadListener(callback) { | |
return; | |
} | |
/*? } */ | |
- /*? if(platform==='thunderbird'){ */ | |
- if (!matched | |
- && typeof(g_mozStringBundle) === 'object' | |
- && Object.keys(g_mozStringBundle).length > 0) { | |
- matched = true; | |
- // Already loaded | |
- Utils.nextTick(callback); | |
- return; | |
- } | |
- /*? } */ | |
g_stringBundleLoadListeners.push(callback); | |
} | |
@@ -862,26 +737,6 @@ function getMozStringBundle() { | |
return stringBundleObj; | |
} | |
-/*? if(platform==='thunderbird'){ */ | |
-// Load the Mozilla string bundle | |
-if (typeof(chrome) === 'undefined' && typeof(safari) === 'undefined') { | |
- var g_mozStringBundle = getMozStringBundle(); | |
- | |
- if (!g_mozStringBundle || Object.keys(g_mozStringBundle).length === 0) { | |
- window.setTimeout(function requestMozStringBundle() { | |
- makeRequestToPrivilegedScript(window.document, {action: 'get-string-bundle'}, function(response) { | |
- g_mozStringBundle = response; | |
- triggerStringBundleLoadListeners(); | |
- }); | |
- }, 0); | |
- } | |
- else { | |
- // g_mozStringBundle is filled in | |
- triggerStringBundleLoadListeners(); | |
- } | |
-} | |
-/*? } */ | |
- | |
/*? if(platform==='safari'){ */ | |
// Will only succeed when called from a privileged Safari script. | |
@@ -1010,7 +865,7 @@ function getMessage(messageID) { | |
// (This if-structure is ugly to work around the preprocessor logic.) | |
var matched = false; | |
- /*? if (platform==='chrome' || platform==='firefox') { */ | |
+ /*? if (platform==='chrome' || platform==='firefox' || platform==='thunderbird') { */ | |
if (typeof(chrome) !== 'undefined') { | |
matched = true; | |
message = chrome.i18n.getMessage(messageID); | |
@@ -1028,18 +883,7 @@ function getMessage(messageID) { | |
} | |
} | |
/*? } */ | |
- /*? if (platform==='thunderbird') { */ | |
- if (!matched) { // Mozilla | |
- matched = true; | |
- if (g_mozStringBundle) { | |
- message = g_mozStringBundle[messageID]; | |
- } | |
- else { | |
- // We don't yet have the string bundle available | |
- return ''; | |
- } | |
- } | |
- /*? } */ | |
+ | |
if (!message) { | |
throw new Error('Could not find message ID: ' + messageID); | |
@@ -1252,13 +1096,6 @@ Utils.setFocus = setFocus; | |
Utils.getTopURL = getTopURL; | |
Utils.nextTick = nextTick; | |
Utils.nextTickFn = nextTickFn; | |
-/*? if(platform==='thunderbird'){ */ | |
-Utils.getMozStringPref = getMozStringPref; | |
-Utils.getMozJsonPref = getMozJsonPref; | |
-Utils.setMozStringPref = setMozStringPref; | |
-Utils.setMozJsonPref = setMozJsonPref; | |
-Utils.getMozStringBundle = getMozStringBundle; | |
-/*? } */ | |
/*? if(platform==='safari'){ */ | |
Utils.getSafariStringBundle = getSafariStringBundle; | |
/*? } */ | |
diff --git a/src/manifest-browser.json b/src/manifest-browser.json | |
new file mode 100644 | |
index 0000000..f3c5af4 | |
--- /dev/null | |
+++ b/src/manifest-browser.json | |
@@ -0,0 +1,52 @@ | |
+{ | |
+ "manifest_version": 2, | |
+ "name": "__MSG_app_name__", | |
+ "version": "2.13.4", | |
+ "description": "__MSG_app_slogan__", | |
+ "homepage_url": "http://markdown-here.com", | |
+ "default_locale": "en", | |
+ "icons": { | |
+ "16": "common/images/icon16.png", | |
+ "32": "common/images/icon32.png", | |
+ "48": "common/images/icon48.png", | |
+ "128": "common/images/icon128.png", | |
+ "512": "common/images/icon512.png" | |
+ }, | |
+ "permissions": ["contextMenus", "storage"], | |
+ "background": {"page": "chrome/background.html"}, | |
+ "content_scripts": [ | |
+ { | |
+ "matches": ["http://*/*", "https://*/*"], | |
+ "js": [ | |
+ "common/utils.js", | |
+ "common/common-logic.js", | |
+ "common/jsHtmlToText.js", | |
+ "common/marked.js", | |
+ "common/mdh-html-to-text.js", | |
+ "common/markdown-here.js", | |
+ "chrome/contentscript.js" | |
+ ] | |
+ } | |
+ ], | |
+ "browser_action": { | |
+ "default_icon": { | |
+ "16": "common/images/icon16-button-monochrome.png", | |
+ "19": "common/images/icon19-button-monochrome.png", | |
+ "32": "common/images/icon32-button-monochrome.png", | |
+ "38": "common/images/icon38-button-monochrome.png", | |
+ "64": "common/images/icon64-button-monochrome.png" | |
+ }, | |
+ "default_title": "__MSG_toggle_button_tooltip__", | |
+ "browser_style": true | |
+ }, | |
+ "options_ui": { | |
+ "page": "common/options.html", | |
+ "open_in_tab": true | |
+ } | |
+ | |
+ ,"applications": { | |
+ "gecko": { | |
+ "id": "[email protected]" | |
+ } | |
+ } | |
+} | |
diff --git a/src/manifest-thunderbird.json b/src/manifest-thunderbird.json | |
new file mode 100755 | |
index 0000000..5a4133a | |
--- /dev/null | |
+++ b/src/manifest-thunderbird.json | |
@@ -0,0 +1,39 @@ | |
+{ | |
+ "manifest_version": 2, | |
+ "name": "__MSG_app_name__", | |
+ "version": "2.13.4", | |
+ "description": "__MSG_app_slogan__", | |
+ "homepage_url": "http://markdown-here.com", | |
+ "default_locale": "en", | |
+ "icons": { | |
+ "16": "common/images/icon16.png", | |
+ "32": "common/images/icon32.png", | |
+ "48": "common/images/icon48.png", | |
+ "128": "common/images/icon128.png", | |
+ "512": "common/images/icon512.png" | |
+ }, | |
+ "permissions": ["compose", "storage"], | |
+ "background": {"page": "chrome/background.html"}, | |
+ "compose_action": { | |
+ "browser_style": true, | |
+ "default_area": "formattoolbar", | |
+ "default_icon": { | |
+ "16": "common/images/icon16-button-monochrome.png", | |
+ "19": "common/images/icon19-button-monochrome.png", | |
+ "32": "common/images/icon32-button-monochrome.png", | |
+ "38": "common/images/icon38-button-monochrome.png", | |
+ "64": "common/images/icon64-button-monochrome.png" | |
+ }, | |
+ "default_title": "__MSG_toggle_button_tooltip__" | |
+ }, | |
+ "options_ui": { | |
+ "page": "common/options.html", | |
+ "open_in_tab": true | |
+ }, | |
+ "applications": { | |
+ "gecko": { | |
+ "id": "[email protected]", | |
+ "strict_min_version": "78.5" | |
+ } | |
+ } | |
+} | |
diff --git a/src/manifest.json b/src/manifest.json | |
old mode 100644 | |
new mode 100755 | |
index f3c5af4..5a4133a | |
--- a/src/manifest.json | |
+++ b/src/manifest.json | |
@@ -1,52 +1,39 @@ | |
-{ | |
- "manifest_version": 2, | |
- "name": "__MSG_app_name__", | |
- "version": "2.13.4", | |
- "description": "__MSG_app_slogan__", | |
- "homepage_url": "http://markdown-here.com", | |
- "default_locale": "en", | |
- "icons": { | |
- "16": "common/images/icon16.png", | |
- "32": "common/images/icon32.png", | |
- "48": "common/images/icon48.png", | |
- "128": "common/images/icon128.png", | |
- "512": "common/images/icon512.png" | |
- }, | |
- "permissions": ["contextMenus", "storage"], | |
- "background": {"page": "chrome/background.html"}, | |
- "content_scripts": [ | |
- { | |
- "matches": ["http://*/*", "https://*/*"], | |
- "js": [ | |
- "common/utils.js", | |
- "common/common-logic.js", | |
- "common/jsHtmlToText.js", | |
- "common/marked.js", | |
- "common/mdh-html-to-text.js", | |
- "common/markdown-here.js", | |
- "chrome/contentscript.js" | |
- ] | |
- } | |
- ], | |
- "browser_action": { | |
- "default_icon": { | |
- "16": "common/images/icon16-button-monochrome.png", | |
- "19": "common/images/icon19-button-monochrome.png", | |
- "32": "common/images/icon32-button-monochrome.png", | |
- "38": "common/images/icon38-button-monochrome.png", | |
- "64": "common/images/icon64-button-monochrome.png" | |
- }, | |
- "default_title": "__MSG_toggle_button_tooltip__", | |
- "browser_style": true | |
- }, | |
- "options_ui": { | |
- "page": "common/options.html", | |
- "open_in_tab": true | |
- } | |
- | |
- ,"applications": { | |
- "gecko": { | |
- "id": "[email protected]" | |
- } | |
- } | |
-} | |
+{ | |
+ "manifest_version": 2, | |
+ "name": "__MSG_app_name__", | |
+ "version": "2.13.4", | |
+ "description": "__MSG_app_slogan__", | |
+ "homepage_url": "http://markdown-here.com", | |
+ "default_locale": "en", | |
+ "icons": { | |
+ "16": "common/images/icon16.png", | |
+ "32": "common/images/icon32.png", | |
+ "48": "common/images/icon48.png", | |
+ "128": "common/images/icon128.png", | |
+ "512": "common/images/icon512.png" | |
+ }, | |
+ "permissions": ["compose", "storage"], | |
+ "background": {"page": "chrome/background.html"}, | |
+ "compose_action": { | |
+ "browser_style": true, | |
+ "default_area": "formattoolbar", | |
+ "default_icon": { | |
+ "16": "common/images/icon16-button-monochrome.png", | |
+ "19": "common/images/icon19-button-monochrome.png", | |
+ "32": "common/images/icon32-button-monochrome.png", | |
+ "38": "common/images/icon38-button-monochrome.png", | |
+ "64": "common/images/icon64-button-monochrome.png" | |
+ }, | |
+ "default_title": "__MSG_toggle_button_tooltip__" | |
+ }, | |
+ "options_ui": { | |
+ "page": "common/options.html", | |
+ "open_in_tab": true | |
+ }, | |
+ "applications": { | |
+ "gecko": { | |
+ "id": "[email protected]", | |
+ "strict_min_version": "78.5" | |
+ } | |
+ } | |
+} | |
-- | |
2.25.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment