Skip to content

Commit

Permalink
add an option to disable the extension on windows platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ubermanu committed Mar 20, 2023
1 parent b9c4ed6 commit 4a4f919
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ubermanu/roller",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",
"description": "Browser extension that allow auto scrolling of web pages, by pressing the mouse wheel button",
"keywords": [
Expand Down
8 changes: 8 additions & 0 deletions src/components/OptionsPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@
</label>
</div>
</div>
<div class="field">
<div class="control">
<label class="checkbox">
<input type="checkbox" bind:checked={$options.disableOnWindows} />{' '}
{$_('Disable on Windows platform')}
</label>
</div>
</div>
</section>
<section class="section">
<div class="buttons">
Expand Down
3 changes: 3 additions & 0 deletions src/contentScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const autoScroll = new AutoScroll()

// TODO: Restore listener on option changes
chrome?.storage?.local.get(defaults, (options) => {
if (navigator.platform === 'Win32' && options.disableOnWindows) {
return
}
autoScroll.$$set({ options })
htmlNode.appendChild(autoScroll)
})
Expand Down
1 change: 1 addition & 0 deletions src/defaultOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export default {
shouldCap: false,
ctrlClick: true,
middleClick: true,
disableOnWindows: true,
}
1 change: 1 addition & 0 deletions src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"Advanced": "Avancé",
"Scroll on inner elements": "Défiler dans les éléments intérieurs",
"Scroll when clicking on a link or textarea": "Défiler si un lien ou un champ text est cliqué",
"Disable on Windows platform": "Désactiver sur Windows",
"Save": "Enregistrer",
"Reset": "Réinitialiser"
}

0 comments on commit 4a4f919

Please sign in to comment.