/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* jshint moz: true */ /* Dialog / Popup ===================================== */ // dialog names (used as dialog identifiers) const dialogNames = { "promptToShare": "promptToShareData", "resetData": "resetData", "blockSites": "blockSites", "hideSites": "hideSites", "startUploadData": "startUploadData", "stopUploadData": "stopUploadData", "privateBrowsing": "privateBrowsing", "saveOldData": "saveOldData" }; const allDialogs = { 'Reset Data Confirmation': confirmResetDataDialog, 'Block Sites Confirmation': confirmBlockSitesDialog, 'Hide Sites Confirmation': confirmHideSitesDialog, 'Upload Data Confirmation': askForDataSharingConfirmationDialog, 'Stop Uploading Data Confirmation': stopSharingDialog, 'Private Browsing Notification': informUserOfUnsafeWindowsDialog, }; // options: name, title, message, type, dnsPrompt(Do Not Show), imageUrl function dialog(options, callback) { createDialog(options, callback); } function createDialog(options, callback) { var modal = picoModal({ content: createDialogContent(options), closeButton: false, overlayClose: false, overlayStyles: { backgroundColor: "#000", opacity: 0.75 } }); addDialogEventHandlers(modal, options, function (userResponse) { callback(userResponse); }); } function createDialogContent(options) { return dialogTitleBar(options) + dialogMessage(options) + dialogControls(options); } function dialogTitleBar(options) { return "
You are about to start uploading data to the Lightbeam server. Your data will continue to be uploaded periodically until you turn off sharing. For more information about the data we upload, how we take steps to minimize risk of re-identification, and what Mozilla\'s privacy policies are, please read the the Lightbeam Privacy Policy.
' + // Lightbeam Privacy Policy. 'We care about your privacy. Lightbeam is a browser add-on that collects and helps you visualize third party requests on any site you visit. If you choose to send Lightbeam data to Mozilla (that’s us), our privacy policy describes how we handle that data.
Your privacy is an important factor that Mozilla (that\'s us) considers in the development of each of our products and services. We are committed to being transparent and open and want you to know how we receive information about you, and what we do with that information once we have it.
For us, "personal information" means information which identifies you, like your name or email address.
Any information that falls outside of this is "non-personal information."
If we store your personal information with information that is non-personal, we will consider the combination as personal information. If we remove all personal information from a set of data then the remaining is non-personal information.
We learn information about you when:
When you give us personal information, we will use it in the ways for which you\'ve given us permission. Generally, we use your information to help us provide and improve our products and services for you.
We are committed to protecting your personal information once we have it. We implement physical, business and technical security measures. Despite our efforts, if we learn of a security breach, we\'ll notify you so that you can take appropriate protective steps.
We also don\'t want your personal information for any longer than we need it, so we only keep it long enough to do what we collected it for. Once we don\'t need it, we take steps to destroy it unless we are required by law to keep it longer.
We\'re a global organization and our computers are in several different places around the world. We also use service providers whose computers may also be in various countries. This means that your information might end up on one of those computers in another country, and that country may have a different level of data protection regulation than yours. By giving us information, you consent to this kind of transfer of your information. No matter what country your information is in, we comply with applicable law and will also abide by the commitments we make in this privacy policy.
If you are under 13, we don\'t want your personal information, and you must not provide it to us. If you are a parent and believe that your child who is under 13 has provided us with personal information, please contact us at lightbeam-privacy@mozilla.org to have your child\'s information removed.
We may need to change this policy and when we do, we\'ll notify you.
By clicking OK, you are agreeing to the data practices in our privacy notice.
', "imageUrl": "image/lightbeam_popup_warningsharing.png" }, callback); } function stopSharingDialog(callback) { dialog({ "name": dialogNames.stopUploadData, "title": "Stop Uploading Data", "message": 'You are about to stop sharing data with the Lightbeam server.
' + 'By clicking OK you will no longer be uploading data.
', "imageUrl": "image/lightbeam_popup_stopsharing2.png" }, function (confirmed) { callback(confirmed); } ); } function informUserOfUnsafeWindowsDialog() { dialog({ "type": "alert", "name": dialogNames.privateBrowsing, "dnsPrompt": true, "title": "Private Browsing", "message": "You have one or more private browsing windows open.
" + "Connections made in private browsing windows will be visualized in Lightbeam but that data is neither stored locally nor will it ever be shared, even if sharing is enabled.
" + "Information gathered in private browsing mode will be deleted whenever Lightbeam is restarted, and is not collected at all when Lightbeam is not open..
", "imageUrl": "image/lightbeam_popup_privacy.png" }, function (confirmed) {} ); } function confirmBlockSitesDialog(callback) { dialog({ "name": dialogNames.blockSites, "title": "Block Sites", "message": "Warning:
" + "Blocking sites will prevent any and all content from being loaded from selected domains, for example: [example.com, example.net] and all of their subdomains [mail.example.com, news.example.net etc.].
" + "This can prevent some sites from working and degrade your internet experience. Please use this feature carefully.
", "imageUrl": "image/lightbeam_popup_blocked.png" }, callback ); } function confirmHideSitesDialog(callback) { dialog({ "name": dialogNames.hideSites, "dnsPrompt": true, "title": "Hide Sites", "message": "These sites will not be shown in Lightbeam visualizations, including List View, unless you specifically toggle them back on with the Show Hidden Sites button.
" + "You can use this to ignore trusted sites from the data.
", "imageUrl": "image/lightbeam_popup_hidden.png" }, callback ); } function confirmResetDataDialog(callback) { dialog({ "name": dialogNames.resetData, "title": "Reset Data", "message": "Pressing OK will delete all Lightbeam information including connection history, user preferences, block sites list etc.
" + "Your browser will be returned to the state of a fresh install of Lightbeam.
", "imageUrl": "image/lightbeam_popup_warningreset.png" }, callback); }