diff --git a/.eslintignore b/.eslintignore [DEPRECATED] similarity index 100% rename from .eslintignore rename to .eslintignore [DEPRECATED] diff --git a/.eslintrc.js b/.eslintrc.js [DEPRECATED] similarity index 91% rename from .eslintrc.js rename to .eslintrc.js [DEPRECATED] index fcea33a..8ebc3c0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js [DEPRECATED] @@ -1,4 +1,8 @@ +/* eslint-disable quotes */ + module.exports = { + "root": true, + "env": { "browser": true, "es6": true, @@ -6,11 +10,25 @@ module.exports = { "jquery": true, // "node": true }, + + "parserOptions": { + // "ecmaVersion": 12, + "ecmaVersion": "latest", + "sourceType": "script", + "ecmaFeatures": { + "globalReturn ": true, + "impliedStrict": true, + // "jsx": true, + }, + }, + // "extends": "eslint:all", // "extends": "eslint:recommended", "extends": [ "eslint:recommended", // "eslint:all", + "plugin:css/recommended", + "plugin:jsonc/recommended-with-json", // "plugin:no-jquery/recommended", "plugin:no-jquery/deprecated", // "plugin:no-jquery/slim", @@ -18,23 +36,16 @@ module.exports = { // "plugin:clean-regex/recommended" "plugin:regexp/recommended", // "plugin:regexp/all", - ], + "plugins": [ + "css", + "jsonc", // "clean-regex", - "regexp", "no-jquery", + "regexp", ], - "parserOptions": { - // "ecmaVersion": 12, - "ecmaVersion": 'latest', - "sourceType": "script", - "ecmaFeatures": { - "globalReturn ": true, - "impliedStrict": true, - // "jsx": true, - }, - }, + "rules": { "complexity": ["warn", 20], "eqeqeq": "warn", @@ -49,6 +60,7 @@ module.exports = { "new-cap": "off", "no-alert": "warn", "no-console": "warn", + "no-dupe-keys": "warn", "no-extra-semi": "warn", "no-inline-comments": "off", "no-magic-numbers": "off", @@ -69,8 +81,8 @@ module.exports = { "space-before-function-paren": "off", // "space-in-parens": ["warn", "always"], "unicode-bom": ["warn", "never"], - }, + "reportUnusedDisableDirectives": true }; diff --git a/.eslintrc.json [DEPRECATED] b/.eslintrc.json [DEPRECATED] new file mode 100644 index 0000000..a34a4d6 --- /dev/null +++ b/.eslintrc.json [DEPRECATED] @@ -0,0 +1,61 @@ +{ + "root": true, + "env": { + "browser": true, + "es6": true, + "greasemonkey": true, + "jquery": true + }, + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "script", + "ecmaFeatures": { + "globalReturn ": true, + "impliedStrict": true + } + }, + "extends": [ + "eslint:recommended", + "plugin:css/recommended", + "plugin:jsonc/recommended-with-json", + "plugin:no-jquery/deprecated", + "plugin:regexp/recommended" + ], + "plugins": [ + "css", + "jsonc", + "no-jquery", + "regexp" + ], + "rules": { + "complexity": ["warn", 20], + "eqeqeq": "warn", + "func-style": "off", + "indent": ["warn","tab", { "ignoreComments": false, "SwitchCase": 1 } ], + "linebreak-style": ["warn","unix"], + "max-len": "off", + "max-statements-per-line": "off", + "new-cap": "off", + "no-alert": "warn", + "no-console": "warn", + "no-dupe-keys": "warn", + "no-extra-semi": "warn", + "no-inline-comments": "off", + "no-magic-numbers": "off", + "no-misleading-character-class": "warn", + "no-mixed-spaces-and-tabs": "warn", + "no-multiple-empty-lines": "off", + "no-tabs": "off", + "no-unused-labels": "warn", + "no-unused-vars": ["warn", {"vars": "all", "args": "after-used"}], + "no-useless-escape": "warn", + "padded-blocks": "off", + "quotes": ["warn", "single", { "allowTemplateLiterals": true }] , + "require-jsdoc": "off", + "require-unicode-regexp": "off", + "semi": ["warn","always"], + "space-before-function-paren": "off", + "unicode-bom": ["warn", "never"] + }, + "reportUnusedDisableDirectives": true +} diff --git a/.gitattributes b/.gitattributes index bdb0cab..1e78b8c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ # Auto detect text files and perform LF normalization -* text=auto +* text=auto eol=lf # Custom for Visual Studio *.cs diff=csharp diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 000d73e..75d11ec 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,8 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" # Check for updates to GitHub Actions every week diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index b9d2149..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,72 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '23 10 * * 6' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - queries: +security-and-quality - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # âšī¸ Command-line programs to run using the OS shell. - # đ https://git.io/JvXDl - - # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index f2605b7..b9d6d20 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -9,6 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Dependency Review' - uses: actions/dependency-review-action@v1 + uses: actions/dependency-review-action@v4 diff --git a/.github/workflows/evergreen.yml b/.github/workflows/evergreen.yml new file mode 100644 index 0000000..57eb768 --- /dev/null +++ b/.github/workflows/evergreen.yml @@ -0,0 +1,22 @@ +name: Weekly dependabot checks + +on: + workflow_dispatch: + schedule: + - cron: '3 2 1 * *' + +permissions: + issues: write + pull-requests: write + +jobs: + evergreen: + name: evergreen + runs-on: ubuntu-latest + + steps: + - name: Run evergreen action + uses: github/evergreen@v1 + env: + GH_TOKEN: ${{ secrets.EVERGREEN_ACTION }} + REPOSITORY: darkred diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 45705e4..f2415f5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,7 +24,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install modules run: npm install - name: Run ESLint diff --git a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js index 0d94536..3c5be12 100644 --- a/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js +++ b/Instagram_-_visible_images_counter/Instagram_-_visible_images_counter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Instagram - visible images counter // @namespace darkred -// @version 2022.6.12 +// @version 2024.2.23 // @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page. // @author darkred // @license MIT @@ -55,7 +55,9 @@ function showCounter() { // hrefselems = document.querySelectorAll(`a[href*='taken-by']`); - hrefselems = document.querySelectorAll(`._aabd._aa8k._aanf > a`); + // hrefselems = document.querySelectorAll(`._aabd._aa8k._aanf > a`); + // hrefselems = document.querySelectorAll(`._aabd._aa8k._al3l > a`); + hrefselems = document.querySelectorAll(`._aabd._aa8k.x2pgyrj > a`); $.each(hrefselems, function(index, value) { // hrefs.indexOf(String(value)) === -1 ? hrefs.push(String(value)) : console.log("This item already exists"); // https://stackoverflow.com/a/36683363 if (hrefs.indexOf(String(value)) === -1) { // hrefs.count -below- serves as a counter for the newly added displayed images (on each infinite scrolling event) @@ -94,7 +96,7 @@ function createDiv() { function createObserver() { // var thePics = document.querySelector('div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'); - var thePics = document.querySelector('div[style^="flex-direction: column;"], div[style|="padding-top: 0px;"]'); // the "pics" area element, with rows that contain 3 pics each (watching for 'row' element additions) --> https://stackoverflow.com/a/5110337 ("wildcard * in CSS") starting (^=) with x and ending (|=) with y + var thePics = document.querySelector('div[style*="flex-direction: column;"], div[style$="padding-top: 0px;"]'); // the "pics" area element, with rows that contain 3 pics each (watching for 'row' element additions) --> https://stackoverflow.com/a/5110337 ("wildcard * in CSS") starting (^=) with x and ending ($=) with y if (!thePics){ return; } @@ -131,15 +133,19 @@ var div = document.createElement('div'); var observer; // var avatarSelector = 'span[style="width: 152px; height: 152px;"]'; // the profile's photo/avatar element +// var avatarSelector = 'main > article > header > section > div._ienqf > div > button'; // the 3-dots icon +// var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon // var avatarSelector = '._mainc'; // the profile's bio area element // var avatarSelector = 'h1.notranslate'; // the profile name element -// var avatarSelector = 'h1.rhpdm'; // the profile name element -// var avatarSelector = 'span.-nal3'; // the 'posts' count element, e.g. 683 posts -// var avatarSelector = 'ul.k9GMp'; // the profile's 3 counters container element +// var avatarSelector = 'h1.rhpdm'; // the profile name element +// var avatarSelector = 'span.-nal3'; // the 'posts' count element, e.g. 683 posts +// var avatarSelector = 'ul.k9GMp'; // the profile's 3 counters container element // var avatarSelector = '.eC4Dz'; // the profile's username container element -var avatarSelector = '._aa_m'; // the profile's username container element +// var avatarSelector = '._aa_m'; // the profile's username container element +// var avatarSelector = '._aa_c'; // the profile's username container element // var avatarSelector = 'main > article > header > section > div._ienqf > div > button'; // the 3-dots icon -// var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon +// var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon +var avatarSelector = '.x1q0g3np.x2lah0s.x8j4wrb'; // the 3-dots icon @@ -199,7 +205,7 @@ window.addEventListener('popstate', function () { (function(){ var rs = history.pushState; history.pushState = function(state, title, url){ - if ( !url.includes('/following/') && !url.includes('/followers/') && !url.includes('/p/') && !url.includes('/direct/') ){ // avoid all possible in-page/popup "pages" (a profile's following/followers, and posts -opened by clicking on a thumb-) + if ( !url.includes('/following/') && !url.includes('/followers/') && !url.includes('/p/') && !url.includes('/direct/') && !window.location.href.includes('/p/') ){ // avoid all possible in-page/popup "pages" (a profile's following/followers, and posts -opened by clicking on a thumb-) rs.apply(history, arguments); // preserve normal functionality console.log('navigating', arguments); // do something extra here; raise an event removeCounter(); diff --git a/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js b/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js index 8f7306f..0e79958 100644 --- a/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js +++ b/ProtonMail_-_remove_forced_signature/ProtonMail_-_remove_forced_signature.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name ProtonMail - remove forced signature // @namespace darkred -// @version 2022.7.11 +// @version 2023.6.1 // @description Removes the forced ProtonMail signature from the 'New message' textboxes // @author darkred // @license MIT @@ -27,34 +27,45 @@ document.arrive(elementToWatch, function () { const callback = function(mutationList, observer) { mutationList.forEach( (mutation) => { mutation.addedNodes.forEach( (node) => { - if (node.className === 'protonmail_signature_block') { + + const refNode = 'protonmail_signature_block'; + + if (node.className === refNode) { // DOM STRUCTURE: // - // The 2 previous element siblings of the main signature element, '.protonmail_signature_block', are both