-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] Override default settings through url parameters #174 #209
base: main
Are you sure you want to change the base?
Conversation
✔️ Deploy Preview for svgomg ready! 🔨 Explore the source changes: 8588932 🔍 Inspect the deploy log: https://app.netlify.com/sites/svgomg/deploys/618d2a81ae336a0007f557a2 😎 Browse the preview: https://deploy-preview-209--svgomg.netlify.app |
@Mojeer0 can you rebase and make sure tests are green? |
a90dc7e
to
cb9ccc9
Compare
src/js/page/main-controller.js
Outdated
@@ -250,7 +250,12 @@ export default class MainController { | |||
} | |||
|
|||
async _loadSettings() { | |||
const settings = await storage.get('settings'); | |||
let settings = await storage.get('settings'); | |||
settings = Object.assign( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be a spread instead
This doesn't seem to work when Service Workers are disabled. |
The parent element already has the title set. Also, add `aria-hidden="true"` in the SVGs.
430863b
to
8588932
Compare
This change allow to override svgomg default settings through url parameters. #174
It's usefull when you want to share svomg to coworkers without asking them to check/uncheck some options.
Seach parameters names are the same as the input name attribute, which also are the same as svgo options name. For example to set "Prefer viewBox to width/height" by default one would use https://jakearchibald.github.io/svgomg/?removeDimensions=true
Options from the url parameters are taken into account at 2 moments:
Fixes #174