diff --git a/README.md b/README.md index c98cd8b6..8df2cf55 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,8 @@ Changes - Landmarks are now updated when pages change dynamically (not just when the whole page is loaded). This should make the extension much more useful when working with web-apps and pages with pop-ups and slide-out menus, for example. [[#111]](https://github.com/matatk/landmarks/pull/111) - Add a keyboard shortcut to skip to the main landmark. [[also #111]](https://github.com/matatk/landmarks/pull/111) - Fix a bug whereby sibling landmarks may not be identified as such. [[#112]](https://github.com/matatk/landmarks/pull/112) - - Use Mozilla's 'addons-linter' + - Adopt more browser-like UI on Firefox (pop-up and options) and Opera (options). [[#115]](https://github.com/matatk/landmarks/pull/115) + - Use Mozilla's 'addons-linter' to check the built extension. [[err, also #111]](https://github.com/matatk/landmarks/pull/111) - 2.0.8 - 18th of September 2017 - Landmarks now ignores hidden regions. [[#85]](https://github.com/matatk/landmarks/pull/85) - Fix a bug that caused the pop-up to incorrectly report nesting that changes by more than one level between landmarks. [[#102]](https://github.com/matatk/landmarks/pull/102) diff --git a/package-lock.json b/package-lock.json index 0f1fc1ad..f6d1fc6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,9 +49,9 @@ } }, "addons-linter": { - "version": "0.28.0", - "resolved": "https://registry.npmjs.org/addons-linter/-/addons-linter-0.28.0.tgz", - "integrity": "sha512-fGiMPHFyT/iui5oeb1F/EfOIrSnmEIZxqUju85oy3pVaL2s76msvteJoZ6IkommFhtlZqj8wsPwSiTAPC43fcg==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/addons-linter/-/addons-linter-0.28.1.tgz", + "integrity": "sha512-9T3oqhlWdB4KovRMv/FhWFflVAvv1ynlDTfExFRHJsQaRR9UJ+SjO86c7YcQ/AUu83OTomjei41qICMVvPOFRA==", "dev": true, "requires": { "ajv": "5.2.5", @@ -64,13 +64,13 @@ "dispensary": "0.11.0", "doctoc": "1.3.0", "es6-promisify": "5.0.0", - "eslint": "4.9.0", + "eslint": "4.10.0", "eslint-plugin-no-unsafe-innerhtml": "1.0.16", "esprima": "3.1.3", "first-chunk-stream": "2.0.0", "fluent": "0.4.1", "jed": "1.1.1", - "pino": "4.8.2", + "pino": "4.9.0", "postcss": "6.0.13", "relaxed-json": "1.0.1", "semver": "5.4.1", @@ -80,7 +80,7 @@ "whatwg-url": "6.3.0", "xmldom": "0.1.27", "yargs": "9.0.1", - "yauzl": "2.8.0" + "yauzl": "2.9.1" }, "dependencies": { "ajv": { @@ -95,12 +95,6 @@ "json-stable-stringify": "1.0.1" } }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", @@ -121,69 +115,6 @@ "supports-color": "4.5.0" } }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "eslint": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.9.0.tgz", - "integrity": "sha1-doedJ0BoJhsZH+Dy9Wx0wvQgjos=", - "dev": true, - "requires": { - "ajv": "5.2.5", - "babel-code-frame": "6.26.0", - "chalk": "2.2.2", - "concat-stream": "1.6.0", - "cross-spawn": "5.1.0", - "debug": "3.1.0", - "doctrine": "2.0.0", - "eslint-scope": "3.7.1", - "espree": "3.5.1", - "esquery": "1.0.0", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "file-entry-cache": "2.0.0", - "functional-red-black-tree": "1.0.1", - "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.7", - "imurmurhash": "0.1.4", - "inquirer": "3.3.0", - "is-resolvable": "1.0.0", - "js-yaml": "3.10.0", - "json-stable-stringify": "1.0.1", - "levn": "0.3.0", - "lodash": "4.17.4", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "optionator": "0.8.2", - "path-is-inside": "1.0.2", - "pluralize": "7.0.0", - "progress": "2.0.0", - "require-uncached": "1.0.3", - "semver": "5.4.1", - "strip-ansi": "4.0.0", - "strip-json-comments": "2.0.1", - "table": "4.0.2", - "text-table": "0.2.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - }, "supports-color": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", @@ -1101,7 +1032,7 @@ "array-from": "2.1.1", "async": "2.5.0", "natural-compare-lite": "1.4.0", - "pino": "4.8.2", + "pino": "4.9.0", "request": "2.83.0", "semver": "5.4.1", "sha.js": "2.4.9", @@ -1853,9 +1784,9 @@ "dev": true }, "fast-safe-stringify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-1.2.0.tgz", - "integrity": "sha1-69QmZv0Y/k8rpPDSlQZfP4XK3pY=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-1.2.1.tgz", + "integrity": "sha512-g2UqeO0yyYjTSpiH4zJQk+IycRxyYRABjSf+TpmeMOn9uByzFIoX0y/HnweCFhKb+uuPwjIvqXuK/LTteEBhow==", "dev": true }, "fd-slicer": { @@ -3419,14 +3350,14 @@ } }, "pino": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/pino/-/pino-4.8.2.tgz", - "integrity": "sha512-Cu2uCn1q8Nohvq4EadbnECgTnnY4l/8LvO1l8ojCtvbrWNCZhi1q0MMqhpi17hqgN7N0ZlZMkpUOQOLnRwTUmA==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-4.9.0.tgz", + "integrity": "sha512-5G/vE3d42EV0opHO8YYwOWwBMAvk9nAsNSPYXxYdIDWHb4FdCqvKzuAq2Wb/9tkLUnSxW+4JSHDiQwwp0Qh4Eg==", "dev": true, "requires": { "chalk": "2.3.0", "fast-json-parse": "1.0.3", - "fast-safe-stringify": "1.2.0", + "fast-safe-stringify": "1.2.1", "flatstr": "1.0.5", "pump": "1.0.2", "quick-format-unescaped": "1.1.1", @@ -3543,7 +3474,7 @@ "integrity": "sha1-53VV7z5m4QXUA54T73kgEoT+6RY=", "dev": true, "requires": { - "fast-safe-stringify": "1.2.0" + "fast-safe-stringify": "1.2.1" } }, "read-pkg": { @@ -3706,6 +3637,48 @@ "is-finite": "1.0.2" } }, + "replace-in-file": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-3.0.0.tgz", + "integrity": "sha512-/0oRts4OCzjA3AkUB/jy4RiH8AeWVkvjh75PIRaNFRl2I+OLl4GCxH07TYhZG7gjffTy44kRJftuiIRCxBeQQw==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "glob": "7.1.2", + "yargs": "10.0.3" + }, + "dependencies": { + "yargs": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.0.3.tgz", + "integrity": "sha512-DqBpQ8NAUX4GyPP/ijDGHsJya4tYqLQrjPr95HNsr1YwL3+daCfvBwg7+gIC6IdJhR2kATh3hb61vjzMWEtjdw==", + "dev": true, + "requires": { + "cliui": "3.2.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "8.0.0" + } + }, + "yargs-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.0.0.tgz", + "integrity": "sha1-IdR2Mw5agieaS4gTRb8GYQLiGcY=", + "dev": true, + "requires": { + "camelcase": "4.1.0" + } + } + } + }, "request": { "version": "2.83.0", "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", @@ -4810,9 +4783,9 @@ } }, "yauzl": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.8.0.tgz", - "integrity": "sha1-eUUK/yKyqcWkHvVOAtuQfM+/nuI=", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.9.1.tgz", + "integrity": "sha1-qBmB6nCleUYTOIPwKcWCGok1mn8=", "dev": true, "requires": { "buffer-crc32": "0.2.13", diff --git a/package.json b/package.json index b111828c..187584fc 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "is-mergeable-object": "~1.1", "jsdom": "~11.3", "one-svg-to-many-sized-pngs": "github:matatk/one-svg-to-many-sized-pngs", + "replace-in-file": "~3.0", "rimraf": "~2.6", "test": "~0.6" } diff --git a/scripts/build.js b/scripts/build.js index 4876bb64..216534e9 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -6,6 +6,7 @@ const merge = require('deepmerge') const archiver = require('archiver') const oneSvgToManySizedPngs = require('one-svg-to-many-sized-pngs') const packageJson = require(path.join('..', 'package.json')) +const replace = require('replace-in-file') // For restoring pre-2.0.0 deepmerge behaviour... const isMergeableObject = require('is-mergeable-object') const emptyTarget = value => Array.isArray(value) ? [] : {} @@ -111,6 +112,20 @@ function pathToBuild(browser) { function copyStaticFiles(browser) { logStep('Copying static files...') fse.copySync(srcStaticDir, pathToBuild(browser)) + + if (browser === 'firefox') { + try { + const changes = replace.sync({ + files: pathToBuild('firefox') + '/*.html', + from: '', + to: '' + }) + console.log('Removed inclusion of compatibility.js from:', + changes.join(', ')) + } catch (error) { + console.error('Error occurred:', error) + } + } } diff --git a/src/assemble/manifest.firefox.json b/src/assemble/manifest.firefox.json index 1cb97519..48228924 100644 --- a/src/assemble/manifest.firefox.json +++ b/src/assemble/manifest.firefox.json @@ -13,6 +13,10 @@ } }, + "options_ui": { + "browser_style": true + }, + "applications": { "gecko": { "id": "ariaLandmarkNav@ibm.com", diff --git a/src/assemble/manifest.opera.json b/src/assemble/manifest.opera.json index 4015c774..e71d3301 100644 --- a/src/assemble/manifest.opera.json +++ b/src/assemble/manifest.opera.json @@ -11,6 +11,10 @@ } }, + "options_ui": { + "chrome_style": true + }, + "minimum_opera_version": "44", "background": { diff --git a/src/static/options.html b/src/static/options.html index 76d47d57..99496e59 100644 --- a/src/static/options.html +++ b/src/static/options.html @@ -8,7 +8,7 @@
- @@ -16,7 +16,7 @@
- +
diff --git a/src/static/popup.js b/src/static/popup.js index 2309330e..41b394c7 100644 --- a/src/static/popup.js +++ b/src/static/popup.js @@ -55,6 +55,7 @@ function addText(element, message) { // (Needs to be done this way to avoid CSP violation) function addReloadButton(element) { const button = document.createElement('button') + button.className = 'browser-style' button.appendChild(document.createTextNode( browser.i18n.getMessage('tryReloading'))) button.addEventListener('click', reloadActivePage) @@ -111,6 +112,7 @@ function makeLandmarksTree(landmarks, container) { // Create the
  • for this landmark const item = document.createElement('li') const button = document.createElement('button') + button.className = 'browser-style' button.appendChild(document.createTextNode(landmarkName(landmark))) button.addEventListener('click', function() { focusLandmark(index)