-
Notifications
You must be signed in to change notification settings - Fork 6
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
Remove permissions and tweak the settings panel #24
Open
thatlittlegit
wants to merge
7
commits into
omivore:master
Choose a base branch
from
thatlittlegit:settings-changes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Interestingly, it seems that it isn't even needed. The only case where privileged functionality is needed is tab.executeScript, and that's only done on the delay page, which is in Monastery's host and thus (from FF57 on) automatically allowed. In background.js, we clarify to only notify us if it's the right page. This prevents errors about not having permission, since we'll be told multiple times beforehand about the previous page; saying we only want ours means that we can't possibly error (hopefully).
I find for myself that just seeing the yellow status-page makes me Ctrl-W very quickly, and that thirty seconds is overkill for stopping me from procrastinating. This commit allows configuring in five-second intervals with a minimum of five seconds.
This is a bunch of small, separate changes put into one commit. The main ones: - Make #delaySwitch/#delayLength refer to the checkbox, not the box it's in. Unfortunately, the box still needs to be referred to for CSS reasons, so it is called #delaySwitchSection/etc. instead. - Move the 'remove' button next to the notification, so they can be removed one-at-a-time. - Change the 'Add' button in the notifications section to 'Add Notification', to clarify what's being added. - Remove the 'Notify me when there remains' label: I think it's implied by being directly underneath the checkbox. - Remove many <br/>s to make it more responsive; also adjust the flexboxes to meet this goal. - Put the 'Add' button inline with the sitelist addition entry. - Change italics in the case-sensitivity warning. - If there are no notifications, add a notice to clarify. The only major problems I have at this point are: - The CSS is very duplicated, it'd be nice to reuse some of it. - querySelector is used a lot in the code, it'd be nice to try and avoid using it so much. - The 'Remove' button for a sitelist is very close to the <select/>; unfortunately, I don't have a better way to do the removal with <select/>, and implementing a custom one doesn't seem like a good idea.
Fira Sans looks nice, but it isn't native and results in a request to Google instead of just using the built-in font. The settings panel will automatically use a good font. Unfortunately, the popup won't, and will default to `serif`. In addition, Firefox doesn't support system-ui, so that can't be used either. Right now, I put it to system-ui, sans-serif so it will use it when it can, but unfortunately it will be the slightly-uglier sans-serif right now. I do think that this is better than fetching it from Google Fonts, though.
This was primarily done so the 'Save' button wouldn't block the "Notification Settings" header, but it also let me tweak some other details. For example, the input boxes are now smaller, and the save button is naturally sized.
Fixes omivore#21. Tries to parse the input as a URL. If it fails, then oh well; otherwise, it will extract the hostname, port and pathname and put it in automatically. It even recognizes duplicates: if 'google.com' is already in there, then typing 'https://google.com' will be caught as a duplicate!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR has a few parts:
<all_urls>
permission; this isn't needed, since scripts are only run by Monastery on pages it controls.Most of these are visible in the following screenshot (Firefox 87 on GNOME, Debian unstable):

If you don't like some of the changes, I can revert them (e.g. if you just want the permission change, I can remove most of the others, since the permission change doesn't fit in with everything else).