Skip to content
The mega.nz web client
JavaScript HTML CSS Python PHP Shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
audio Initial commit Nov 16, 2013
cmaps 11671: Bugfix: PDF previewer Adobe font support for foreign languages Jul 11, 2019
contrib chmod +x start.sh Sep 15, 2016
css Merge remote-tracking branch 'origin/13112-ui-firefox-set-expiry-date… Sep 20, 2019
dont-deploy #11626: Merging with DEVELOP 20190903 Sep 2, 2019
fonts Hotfix: Revert montserrat font update. Sep 6, 2019
html Merge remote-tracking branch 'origin/extension-page-improvements' int… Sep 18, 2019
images #11626: Business account overdue payment: Merging with DEVELOP 20190912 Sep 11, 2019
js Hotfix-downgrading-Dexie Sep 19, 2019
lang Updated production language strings from Babel Sep 20, 2019
scripts Codefix: Update Beta deployment script to support individual account … Sep 5, 2019
sounds Merge branch 'develop' into 199-proper-password-input Jan 27, 2016
test #4573: Feature: Update webpack (and React) Aug 21, 2019
.babelrc #4573: Feature: Update webpack (and React) Aug 21, 2019
.editorconfig #adding editor configuration file ".editorconfig" Jul 19, 2019
.gitattributes Initial commit Nov 16, 2013
.gitignore 2549: Feature: Set and read encrypted contact nicknames Jul 18, 2019
.htaccess 2549: Feature: Set and read encrypted contact nicknames Jul 18, 2019
.htmlhintrc help2-fixes Sep 1, 2016
.jscpd.json jscpd config tweak May 21, 2019
.jscsrc Upgrading jQuery to version 3.3.1 Sep 17, 2018
.jshintignore diffcheck related fixes Feb 7, 2017
.jshintrc #12302: allowing "supernew" for jshint May 31, 2019
Gruntfile.js Grunt: do not run htmlmin unnecessarily. Jun 3, 2019
INSTALL.md separate key and message in strongvelope. Mar 8, 2016
LICENCE.md Remove hash mask from links. Feb 6, 2017
LLNzjXXdlp32jwpak9ZZCrKcjM.html separate key and message in strongvelope. Mar 8, 2016
Makefile #5906 - adds support for SharedLocalKVStorage (e.g. a cross tab share… Jan 11, 2017
OneClipboard.swf separate key and message in strongvelope. Mar 8, 2016
README.md Codefix: Translation pulling on Beta server Jul 11, 2019
aesasm.js separate key and message in strongvelope. Mar 8, 2016
android-chrome-144x144.png manifest.json fixup Oct 25, 2018
android-chrome-192x192.png manifest.json fixup Oct 25, 2018
android-chrome-36x36.png manifest.json fixup Oct 25, 2018
android-chrome-48x48.png manifest.json fixup Oct 25, 2018
android-chrome-72x72.png manifest.json fixup Oct 25, 2018
android-chrome-96x96.png manifest.json fixup Oct 25, 2018
blog.xml separate key and message in strongvelope. Mar 8, 2016
chrome.xml separate key and message in strongvelope. Mar 8, 2016
decrypter.js Final on-demand node loading fixes... Jun 17, 2017
dev_deploy.sh Merge branch 'develop' into 199-proper-password-input Jan 27, 2016
downloader.swf separate key and message in strongvelope. Mar 8, 2016
e10s.js #8743: Embedded video player & mp3 support Apr 6, 2018
encrypter.js Final on-demand node loading fixes... Jun 17, 2017
favicon.ico separate key and message in strongvelope. Mar 8, 2016
fileapi.js #5866: Downloads resume support. Aug 25, 2017
google1185e791b368c174.html separate key and message in strongvelope. Mar 8, 2016
index.html #hotfix:index-encoding Jul 19, 2019
index.js Merge branch '12536-spacing-fixes-on-download-bar' into 'develop' Sep 18, 2019
ios_privacy.html Add ios_terms, ios_privacy Dec 18, 2018
ios_terms.html
jsdoc.json Merge branch 'develop' of code.developers.mega.co.nz:web/webclient in… Jul 5, 2016
karma.conf.js Add geolocation messages Jul 17, 2019
keygen.js separate key and message in strongvelope. Mar 8, 2016
loading-sprite_v4.png Hotfix: prevent site hanging if a static server is completely dead Aug 13, 2019
loading-sprite_v4@2x.png Hotfix: prevent site hanging if a static server is completely dead Aug 13, 2019
makecache.js Removed jSrollpane for bottom pages Jun 15, 2017
manifest.json manifest.json fixup Oct 25, 2018
mediainfo.mem flac support, and other streaming improvements. Oct 17, 2018
mobile_privacy.html Update ToS, Privacy Policy, GDPR and Takedown Guidance Policy Dec 18, 2018
mobile_terms.html Resolve error in TOS grammar May 1, 2019
nacl-fast.js now using 'mega.maxWorkers' for the nacl background worker; copied na… Jun 15, 2016
naclworker.js now using 'mega.maxWorkers' for the nacl background worker; copied na… Jun 15, 2016
nodedec.js #9486: business account - merge with Develop20180831 Aug 31, 2018
package-lock.json npm update and fixup Sep 8, 2019
package.json npm update and fixup Sep 8, 2019
pdf.worker.js #5554: Preview of PDF file types using pdf.js - closes #4 Oct 11, 2017
rsaasm.js Merge remote-tracking branch 'remotes/upstream-gitlab/develop' into g… Apr 12, 2016
secureboot.js #11626: Business Repay: avoiding payment breakdown duplications + re… Sep 4, 2019
sitemap.xml Bugfix: Replace general page links to terms page, and remove one link… Aug 7, 2019
sjcl.js Merge remote-tracking branch 'remotes/upstream-gitlab/develop' into g… Apr 12, 2016
strg.js separate key and message in strongvelope. Mar 8, 2016
styleguide.json separate key and message in strongvelope. Mar 8, 2016
update.css Show IE 11 update page again after 14, 7, 4, 2 & 1 days, restyle for … Jun 6, 2019
update.html Show IE 11 update page again after 14, 7, 4, 2 & 1 days, restyle for … Jun 6, 2019
update.js Show IE 11 update page again after 14, 7, 4, 2 & 1 days, restyle for … Jun 6, 2019
webpack.config.js #4573: Feature: Update webpack (and React) Aug 21, 2019

README.md

MEGA Web Client

MEGA provides robust cloud storage with convenient and powerful always-on privacy. MEGA believes in your right to privacy and provides you with the technology tools to protect it. We call it User Controlled Encryption (UCE), and it happens automatically.

Secure Boot

secureboot.js loads all the resources from static content servers and verifies its authenticity by checking the cryptographic hash.

Note: This is not the exact same secureboot.js as we have online at https://mega.nz/``secureboot.js``. We have an automatic process that generates secureboot.js with its cryptographic hashes and all the versioned resource files (file_X.js/file_X.html) as needed based on this repository before prior to updating the live site.

During development it's essential that your set the following localStorage parameters:

// Disables the cryptographic hash verification logic.
localStorage.dd = 1;

There are also various other localStorage parameters that are useful during development:

// Enables vanilla console logging.
localStorage.d = 1;
// Enables full console logging via MegaLogger.
localStorage.minLogLevel = 0;
// Allows you to disable the context menu in the FM for element inspection.
localStorage.contextmenu = 1;

Local webclient setup instructions for Ubuntu (for MEGAchat see INSTALL.md)

  1. Install Apache2:
sudo apt-get install apache2
  1. Create a new virtual host configuration file and edit it:
sudo nano /etc/apache2/sites-available/webclient.conf
  1. Add the following and save the file:
<VirtualHost *:80>
    ServerName webclient.local
    ServerAdmin webmaster@webclient.local
    DocumentRoot /var/www/html/webclient.local
    ErrorLog /var/log/apache2/webclient.local.error.log
    CustomLog /var/log/apache2/webclient.local.access.log combined
    LogLevel warn

    <Directory "/var/www/html/webclient.local">
        AllowOverride All
    </Directory>
</VirtualHost>
  1. Enable the config, also the rewrite and headers modules:
sudo a2ensite webclient.conf
sudo a2enmod rewrite
  1. Edit the hosts file:
sudo nano /etc/hosts
  1. Add the following and save the file:
127.0.0.1       webclient.local
  1. Restart the web server:
sudo systemctl restart apache2
  1. Clone the repository:
cd /var/www/html/
git clone git@code.developers.mega.co.nz:web/webclient.git webclient.local
  1. Set permissions:
sudo chgrp -R www-data /var/www/html/
sudo chown -R <your-username> /var/www/html/
  1. Pull language files:
/var/www/html/webclient.local/scripts/lang.sh
  1. Visit http://webclient.local in your browser.

Directories

  • js/ -- contains all generic JavaScript files
  • html/ -- contains all generic HTML files
  • js/html/ contains all JavaScript files that belong to the specific HTML file of the parent folder
  • js/vendor/ -- contains all JavaScript files from external developers
  • cmaps/ -- contains all Character mapping files for Pdf preview's Adobe font

Our JavaScript Files

  • secureboot.js -- loads all the resources from static content servers and verifies its authenticity by checking the cryptographic hash
  • decrypter.js -- the decrypter which is used as a web worker to decrypt data while downloading
  • encrypter.js -- the encrypter which is used as a web worker to encrypt data while uploading
  • js/avatar.js -- is used for avatar selection, cropping & scaling (all on the client side in the canvas)
  • js/cleartemp.js -- contains clearIt() which is used to purge temp data from the FileSystem API (Chrome only)
  • js/countries.js -- contains all the country names (we should translate these at some point)
  • js/crypto.js -- contains all the cryptographic functions & API handlers
  • js/download.js -- contains all the download logic
  • js/filedrag.js -- event handlers for the upload buttons, file&folder-drag&drop event handling for upload init.
  • js/filetypes.js -- contains all the supported file types based on the file extension to match icons
  • js/fm.js -- file manager core file, contains mainly file manager UI & dialog UI logic
  • js/functions.js -- contains some generic functions that are used throughout the site
  • js/keygen.js -- for cryptographic public/private key pair creation
  • js/mDB.js -- providers the local database abstraction layer for caching of meta-data in IndexedDB
  • js/mega.js -- MegaData class which does most of the data handling (but also some FM UI interaction)
  • js/mouse.js -- captures mouse events for entropy collection
  • js/notify.js -- contains the notifications logic
  • js/thumbnail.js -- client side canvas based thumbnail creation (because thumbnails are encrypted, too)
  • js/upload.js -- contains all the upload logic
  • js/account.js -- contains the user creation & login logic
  • js/zip.js -- JavaScript implementation to create ZIP archives of multiple files on the client side

Vendor JavaScript Files

  • aesasm.js -- general-purpose cryptographic library
  • rsaasm.js -- general-purpose cryptographic library
  • sjcl.js -- Stanford Javascript Crypto Library. This is a modified version with some minor changes, see c211e4ce and de5c3dce

See js/vendor/README.md for more.

You can’t perform that action at this time.