Archived
Cleanup Javascript #2185
Closed
Gusted wants to merge 4 commits from
Javascript-Cleanup into master
pull from: Javascript-Cleanup
merge into: :master
:master
:dependabot/bundler/nokogiri-1.13.6
:dependabot/bundler/addressable-2.8.0
:freddy-m-patch-3
:pr-add_RemoveMyPhone_sponsor
:pr-browser_cleanup_1257_1328_1430
:freddy-m-patch-2
:freddy-m-patch-1
:pr-vpn_hated_one_video
:cdn
:update-nitrohorse-image
:promote-metager-to-card
:hardware
:pr-add_azirevpn
:pr-add_mailfence
:shop
:1673
:pr/1658
:i18n-simple
:sponsorship-edits-nov2019
:i18n
:ipfs
:blacklight447-ptio-patch-3
:blog
:remove-windows-icons
:pr/1147
:i18n-testing
:add-beautify
No Reviewers
Labels
Clear labels
:mag:🤖 Search Engines
I2P
OS
Self-contained networks
Social media
Tor
WIP
XMPP
[m]
approved
dependencies
duplicate
feedback wanted
high priority
iOS
low priority
stale
streaming
todo
wontfix
₿ cryptocurrency
ℹ️ help wanted
↔️ file sharing
⚙️ web extensions
✨ enhancement
❌ software removal
🆕 software suggestion
🆘 critical
🇦🇶 translations
🌐 Social News Aggregators
🌐 hosting
🌐 website issue
🏠 housekeeping
🐛 bug
👁️ browsers
👥 team chat
💢 conflicting
💬 discussion
💻 hardware
📁 file storage
📝 correction
📧 email
🔎 research required
🔐 password managers
🔒 VPN
🔒 file encryption
🖊️ digital notebooks
🗄️ DNS
🗨️ instant messaging (im)
🚫 Windows
🤖 Android
🦊 Firefox
🧰 productivity tools
The Invisible Internet Project (I2P)
Operating Systems
Anything covering the Tor network
active work in progress, do not merge or PR (yet)!
Extensible Messaging and Presence Protocol
Matrix protocol
approved, waiting for a PR
Pull requests that update a dependency file
A label for stalebot if it gets added
Anything related to media streaming.
Issues or bugs that will not be fixed and/or do not have significant impact on the project.
Browser Extension related issues
Anything covering a translated version of the site
*Technical* issues with the website.
Anything primarily related to site cleanup.
Correction of content on the website
Virtual Private Network
Domain Name System
Firefox & forks, about:config etc.
No labels
Milestone
No items
No Milestone
No due date set.
Dependencies
No dependencies set.
Reference: privacyguides/privacytools.io#2185
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
=== true/false.Description
Resolves: none
For someone who spends a lot of time in Javascript, the javascript at privacytools.io was something to not prefer not look at it. So I've made some changes that should have none to little impact in the end result, It's just some code quality and code inconsistency fixed. You can refer to the Summary what exactly has been done. As the code was already targeting ECMA6 I updated some code that was readable in ECMA6 to make it more consistency. Thereby removed some useless
=== true/falseas JavaScript will automatic evaluate if the return result is true/false. I saw thesortable.jsand saw already a security flaw(A variable was reinterpreted as HTML without escaping meta-characters), however fiddling around I saw it has no use-case and not used in production and thereby removed and fixed a little issue withtempSrcto define its aconst. Looking atredirect.js, was giving this whole idea to clean it up and moving it to a object and do thewindow.locationjust once gives it a better 'maintainability status' to add/modify extra redirects. I've replaced some functions that were passed into events intoconst x = () =>so it will be used as declaration rather then a new function, so in the further if e.g. the removing of this event is needed it will use the declaration and not pass off a new function and gives you some good hours debugging(talking from experience). I didn't really saw a discussion/issue open for this, but I think everyone agrees to have better quality in the code.Summary:
main.jsECMA6 ready.=== true/false.Check List
I understand that by not opening an issue about a software/service/similar addition/removal, this pull request will be closed without merging.
I have read and understand the contributing guidelines.
The project is Free Libre and/or Open Source Software
Didn't look at the other changes, but FYI sortable.js is definitely used in production. https://www.privacytools.io/providers/dns/ for example. (I don't think there is any unused code in general but I may be wrong)
I thought so too, but the problem with this was when I checked at the network request,
sortable.jswas never requested and doing a quick search in the code doesn't mention any reference. Well the netlify preview on dns provider doesn't show anything wrong with it.