Skip to content

Commit

Permalink
v1.13.0 / 2022-12-13
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornstar committed Dec 13, 2022
1 parent d19825d commit 7a145fe
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Tumblr Savior Changelog

## v1.13.0 / 2022-12-13
* [`script.js`] Use more specific selectors for hiding sidebar items (Fixes #83)
* [`options.js`] Replace deprecated `extension.getURL` with `runtime.getURL`
* [`package.json`] Update devDependency `addons-linter`
* [`package.json`] Update devDependency `eslint`

## v1.12.1 / 2021-11-10
* [`CI`] Only test on node v16
* [`CI`] Also run `addons-linter` when testing
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tumblr-savior",
"version": "1.12.1",
"version": "1.13.0",
"description": "Would you like to control what shows up on your dashboard? Tumblr Savior is here to save you!",
"scripts": {
"addons-linter": "addons-linter src",
Expand All @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/bjornstar/Tumblr-Savior#readme",
"devDependencies": {
"addons-linter": "^4.1.0",
"eslint": "^8.2.0"
"addons-linter": "^5.24.0",
"eslint": "^8.29.0"
}
}
2 changes: 1 addition & 1 deletion src/data/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ const defaultSettings = {
'show_notice': true,
'show_tags': true,
'show_words': true,
'version': '1.12.1'
'version': '1.13.0'
}; // Initialize default values.
21 changes: 16 additions & 5 deletions src/data/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const defaultSettings = {
'show_notice': true,
'show_tags': true,
'show_words': true,
'version': '1.12.1'
'version': '1.13.0'
}; // Initialize default values.

const BASE_CONTAINER_ID = 'base-container';
Expand All @@ -29,6 +29,7 @@ const CSS_CLASS_MAP = {
contentSource: 'd_FyU',
controlIcon: 'gc3fY', // [1]
controls: 'MCavR', // [3]
desktopContainer: 'B15CE', // [0]
filteredScreen: 'W0ros',
footerWrapper: 'qYXF9',
footer: 'Ha4CC', // [8]
Expand All @@ -39,9 +40,11 @@ const CSS_CLASS_MAP = {
reblog: 'u2tXn', // [1]
reblogHeader: 'fAAi8',
recommendationReasonTopTeaserWrapper: 'n_1Sv',
sidebar: 'vM8CJ', // [4]
sidebarItem: 'FZkjV',
stickyContainer: 'AD_w7',
tags: 'hAFp3', // [3]
textBlock: 'k31gt' //[0]
textBlock: 'k31gt' // [0]
};

/**
Expand All @@ -61,14 +64,22 @@ const styleRules = {
'.has-filtered-content' + howToHide
],
hide_radar: [
'aside > div:nth-child(2)' + howToHide
`aside > ${css('sidebarItem')}:nth-child(2)` + howToHide
],
hide_reblog_header: [
css('reblogHeader') + howToHide,
css('reblog') + '{padding-top:inherit;}'
],
hide_recommended_blogs: [
'aside > div:nth-child(1)' + howToHide
// We can drop the conditional when Firefox supports the :has selector
hide_recommended_blogs: [`
@supports(has) {
${css('desktopContainer')}:has([aria-label="Blogs like this one"])${howToHide}
${css('sidebarItem')}:has([aria-label="Check out these blogs"])${howToHide}
}
@supports not (has) {
${css('sidebar')} ${css('desktopContainer')}:nth-child(1)${howToHide}
aside > ${css('sidebarItem')}:nth-child(1)${howToHide}
}`
],
hide_recommended_posts: [
'.recommended-post' + howToHide
Expand Down
2 changes: 1 addition & 1 deletion src/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function chromeAddToBlackList(info, tab) {
}

const views = chrome.extension.getViews();
const optionsURI = chrome.extension.getURL('data/options.html');
const optionsURI = browser.runtime.getURL('data/options.html');

Array.prototype.forEach.call(views, ({ location }) => {
if (location === optionsURI) location.reload();
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Tumblr Savior",
"version": "1.12.1",
"version": "1.13.0",
"description": "Would you like to control what shows up on your dashboard? Tumblr Savior is here to save you!",
"background": {
"scripts": [ "data/defaults.js", "lib/main.js" ]
Expand Down

0 comments on commit 7a145fe

Please sign in to comment.