Skip to content

Commit

Permalink
Added document.designMode check and fixes for Thunderbird release.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdulcet committed Aug 13, 2021
1 parent e0b90f0 commit 898c57b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions scripts/manifests/thunderbirdmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"short_name": "__MSG_extensionNameShort__",
"version": "0.1",
"version": "0.5",
"author": "Teal Dulcet, rugk",

"description": "__MSG_extensionDescription__",
Expand Down Expand Up @@ -45,7 +45,7 @@
"applications": {
"gecko": {
"id": "unicodify@rugk.github.io",
"strict_min_version": "78.0"
"strict_min_version": "87.0"
}
}
}
6 changes: 1 addition & 5 deletions src/content_scripts/autocorrect.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ let symbolpatterns = null;
// Exceptions, do not autocorrect for these patterns
let antipatterns = null;

// Thunderbird
// https://bugzilla.mozilla.org/show_bug.cgi?id=1641573
const IS_THUNDERBIRD = typeof messenger !== "undefined";

// Chrome
// Adapted from: https://github.com/mozilla/webextension-polyfill/blob/master/src/browser-polyfill.js
const IS_CHROME = Object.getPrototypeOf(browser) !== Object.prototype;
Expand All @@ -63,7 +59,7 @@ const IS_CHROME = Object.getPrototypeOf(browser) !== Object.prototype;
*/
function getCaretPosition(target) {
// ContentEditable elements
if (target.isContentEditable || IS_THUNDERBIRD) {
if (target.isContentEditable || document.designMode === "on") {
target.focus();
const _range = document.getSelection().getRangeAt(0);
if (!_range.collapsed) {
Expand Down
2 changes: 1 addition & 1 deletion src/options/modules/ManualAdjustments.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getBrowserValue } from "/common/modules/BrowserCompat.js";
export function init() {
getBrowserValue({
firefox: "https://addons.mozilla.org/firefox/addon/awesome-emoji-picker/?utm_source=unicodify-addon&utm_medium=addon&utm_content=unicodify-addon-settings-inline&utm_campaign=unicodify-addon-settings-inline",
thunderbird: "https://addons.thunderbird.net/thunderbird/addon/awesome-emoji-picker/reviews/?utm_source=unicodify-addon&utm_medium=addon&utm_content=unicodify-addon-settings-inline&utm_campaign=unicodify-addon-settings-inline",
thunderbird: "https://addons.thunderbird.net/thunderbird/addon/awesome-emoji-picker/?utm_source=unicodify-addon&utm_medium=addon&utm_content=unicodify-addon-settings-inline&utm_campaign=unicodify-addon-settings-inline",
chrome: "https://chrome.google.com/webstore/detail/awesome-emoji-picker/",
}).then((browserUrl) => {
document.getElementById("link-awesome-emoji").href = browserUrl;
Expand Down

0 comments on commit 898c57b

Please sign in to comment.