├── .github └── workflows │ └── test-build.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── configurator.py ├── requirements.txt ├── src ├── branding-template │ ├── LICENSE │ ├── PrivateBrowsing_150.png │ ├── PrivateBrowsing_70.png │ ├── background.png │ ├── branding.nsi │ ├── configure.sh │ ├── content │ │ ├── about-logo.png │ │ ├── about-logo.svg │ │ ├── about-logo@2x.png │ │ ├── about-wordmark.svg │ │ ├── about.png │ │ ├── aboutDialog.css │ │ ├── aboutlogins.svg │ │ ├── firefox-wordmark.svg │ │ ├── jar.mn │ │ └── moz.build │ ├── disk.icns │ ├── document.icns │ ├── document.ico │ ├── document_pdf.ico │ ├── dsstore │ ├── firefox.VisualElementsManifest.xml │ ├── locales │ │ ├── en-US │ │ │ ├── brand.dtd │ │ │ ├── brand.ftl │ │ │ └── brand.properties │ │ ├── jar.mn │ │ └── moz.build │ ├── moz.build │ ├── msix │ │ └── Assets │ │ │ ├── Document44x44.png │ │ │ └── Wide310x150Logo.scale-200.png │ ├── newtab.ico │ ├── newwindow.ico │ ├── pbmode.ico │ ├── pref │ │ └── firefox-branding.js │ ├── private_browsing.VisualElementsManifest.xml │ ├── stubinstaller │ │ ├── bgstub.jpg │ │ ├── installing_page.css │ │ └── profile_cleanup_page.css │ ├── wizHeader.bmp │ ├── wizHeaderRTL.bmp │ └── wizWatermark.bmp ├── changed │ └── browser │ │ └── themes │ │ ├── linux │ │ ├── browser.css │ │ └── webRTC-indicator.css │ │ ├── osx │ │ ├── browser.css │ │ └── webRTC-indicator.css │ │ ├── shared │ │ └── webRTC-indicator.css │ │ └── windows │ │ ├── browser.css │ │ └── webRTC-indicator.css ├── distribution │ ├── policies-flatpak.json │ ├── policies-linux-appimage.json │ ├── policies-linux.json │ └── policies-windows.json ├── launch-app │ ├── CMakeLists.txt │ ├── README.md │ └── src │ │ ├── linux.cpp │ │ ├── mac.cpp │ │ ├── main.cpp │ │ ├── placeholders.hpp │ │ ├── platform_specific.hpp │ │ ├── running_guard.cpp │ │ ├── running_guard.hpp │ │ ├── tray_mac.hpp │ │ └── windows.cpp ├── mac │ ├── Info-aarch64.plist │ ├── Info-x86_64.plist │ └── close-on-window-closed.patch ├── mozconfig.linux ├── mozconfig.linux-aarch64 ├── mozconfig.mac-arm ├── mozconfig.mac-intel ├── mozconfig.windows ├── mozilla_dirsFromLibreWolf.patch ├── open-in-default-browser │ ├── README.md │ ├── builtin-open-in-default-browser.patch │ ├── makefile │ ├── open-in-default-browser │ ├── open-in-default-browser-ext │ │ ├── extension │ │ │ ├── manifest.json │ │ │ └── replaceLinks.js │ │ └── moz.build │ ├── open-in-default-browser-mac │ └── open-in-default-browser.bat ├── packages │ └── appimage │ │ └── neutron.AppImage │ │ ├── AppRun │ │ ├── neutron.desktop │ │ └── usr │ │ └── share │ │ └── icons │ │ └── .gitignore ├── scripts │ ├── build.py │ └── build │ │ ├── appimage │ │ ├── appimage-aarch64 │ │ ├── download-firefox-source │ │ ├── launch-app-linux │ │ ├── launch-app-linux-aarch64 │ │ ├── launch-app-mac-arm │ │ ├── launch-app-mac-intel │ │ ├── launch-app-windows │ │ ├── linux │ │ ├── linux-aarch64 │ │ ├── mac-arm │ │ ├── mac-intel │ │ ├── open-in-default-browser │ │ └── windows └── windows │ ├── app.rc │ ├── fxc.patch │ └── setup.nsi └── test ├── config.json └── test.svg /.github/workflows/test-build.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: Test Build 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the "main" branch 8 | push: 9 | branches: [ "main" ] 10 | pull_request: 11 | branches: [ "main" ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v3 27 | with: 28 | submodules: "recursive" 29 | 30 | # Runs a set of commands using the runners shell 31 | - name: Install Dependencies 32 | run: | 33 | pip install -r requirements.txt 34 | sudo apt install aria2 mingw-w64 alsa libasound2-dev libpulse-dev cbindgen libdbus-glib2.0-cil-dev libgtk-3-0 libgtk-3-dev libpango-1.0-0 libpango1.0-dev nasm libnss3-dev libnss3 libx11-xcb-dev wasi-libc 35 | 36 | # Runs a set of commands using the runners shell 37 | - name: Configure and Build 38 | run: | 39 | python configurator.py -c test/config.json 40 | cd build 41 | python build.py 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # .gitignore - List of filenames git should ignore 2 | 3 | # Filenames that should be ignored wherever they appear 4 | *~ 5 | *.pyc 6 | *.pyo 7 | TAGS 8 | tags 9 | compile_commands.json 10 | toolchains.json 11 | 12 | # Ignore ID generated by idutils and un-ignore id directory (for Indonesian locale) 13 | ID 14 | !id/ 15 | .DS_Store* 16 | *.pdb 17 | *.egg-info 18 | .eslintcache 19 | # Filesystem temporaries 20 | .fuse_hidden* 21 | 22 | # Vim swap files. 23 | .*.sw[a-z] 24 | .sw[a-z] 25 | 26 | # Emacs directory variable files. 27 | **/.dir-locals.el 28 | # Emacs project sentinel files. 29 | **/.projectile 30 | 31 | # User files that may appear at the root 32 | /.mozconfig* 33 | /mozconfig* 34 | /configure 35 | /old-configure 36 | /config.cache 37 | /config.log 38 | /.clang_complete 39 | /machrc 40 | /.machrc 41 | /.cargo 42 | # pyenv artifact 43 | /.python-version 44 | 45 | # Empty marker file that's generated when we check out NSS 46 | security/manager/.nss.checkout 47 | 48 | # Build directories 49 | /obj*/ 50 | 51 | # gecko.log is generated by various test harnesses 52 | /gecko.log 53 | 54 | # Ignore newtab component build assets 55 | browser/components/newtab/logs/ 56 | 57 | # Build directories for js shell 58 | *_DBG.OBJ/ 59 | *_OPT.OBJ/ 60 | /js/src/*-obj/ 61 | /js/src/obj-*/ 62 | 63 | # SpiderMonkey configury 64 | js/src/configure 65 | js/src/old-configure 66 | js/src/autom4te.cache 67 | # SpiderMonkey test result logs 68 | js/src/tests/results-*.html 69 | js/src/tests/results-*.txt 70 | 71 | # Java HTML5 parser classes 72 | parser/html/java/htmlparser/ 73 | parser/html/java/javaparser/ 74 | parser/html/java/javaparser.jar 75 | parser/html/java/translator.jar 76 | 77 | # Ignore the files and directory that Eclipse IDE creates 78 | .project 79 | .cproject 80 | .settings/ 81 | 82 | # Ignore the files and directory that JetBrains IDEs create. 83 | /.idea/ 84 | *.iml 85 | # Android Monitor in Android Studio creates a captures/ directory. 86 | /captures/ 87 | 88 | # Gradle cache. 89 | /.gradle/ 90 | 91 | # Local Gradle configuration properties. 92 | /local.properties 93 | 94 | # Ignore chrome.manifest files from the devtools loader 95 | devtools/client/chrome.manifest 96 | devtools/shared/chrome.manifest 97 | 98 | # Ignore debugger build directories 99 | devtools/client/debugger/assets/build 100 | devtools/client/debugger/assets/module-manifest.json 101 | 102 | # Ignore node_modules directories in devtools 103 | devtools/**/node_modules 104 | 105 | # Ignore browsertime output directory 106 | browsertime-results 107 | 108 | # Tag files generated by GNU Global 109 | GTAGS 110 | GRTAGS 111 | GSYMS 112 | GPATH 113 | 114 | # Git clone directory for updating web-platform-tests 115 | testing/web-platform/sync/ 116 | 117 | # Third party metadata for web-platform-tests 118 | testing/web-platform/products/ 119 | 120 | # Android Gradle artifacts. 121 | mobile/android/gradle/.gradle 122 | 123 | # XCode project cruft 124 | /*.xcodeproj/ 125 | 126 | # Rust/Cargo output from running `cargo` directly 127 | /target/ 128 | 129 | # Ignore mozharness execution files 130 | testing/mozharness/.tox/ 131 | testing/mozharness/build/ 132 | testing/mozharness/logs/ 133 | testing/mozharness/.coverage 134 | testing/mozharness/nosetests.xml 135 | 136 | # Ignore ESLint node_modules 137 | node_modules/ 138 | 139 | # Ignore talos virtualenv and tp5n files. 140 | # The tp5n set is supposed to be decompressed at 141 | # testing/talos/talos/fis|tests/tp5n in order to run tests like tps 142 | # locally. Similarly, running talos requires a Python package virtual 143 | # environment. Both the virtual environment and tp5n files end up littering 144 | # the status command, so we ignore them. 145 | testing/talos/.Python 146 | testing/talos/bin/ 147 | testing/talos/include/ 148 | testing/talos/lib/ 149 | testing/talos/talos/fis/tp5n.zip 150 | testing/talos/talos/fis/tp5n 151 | testing/talos/talos/tests/tp5n.zip 152 | testing/talos/talos/tests/tp5n 153 | testing/talos/talos/tests/devtools/damp.manifest.develop 154 | 155 | # Ignore sync tps logs and reports 156 | tps.log 157 | tps_result.json 158 | 159 | # Ignore files created when running a reftest. 160 | lextab.py 161 | 162 | # Ignore Visual Studio Code workspace files. 163 | .vscode/ 164 | !.vscode/extensions.json 165 | !.vscode/tasks.json 166 | 167 | # Ignore various raptor performance framework files 168 | testing/raptor/.raptor-venv 169 | testing/raptor/raptor-venv 170 | testing/raptor/raptor/tests/json/ 171 | testing/raptor/webext/raptor/auto_gen_test_config.js 172 | 173 | # Ignore appimages 174 | packages/appimage/datcord.AppImage/usr/bin/* 175 | packages/appimage/Datcord-x86_64.AppImage 176 | 177 | # Ignore flatpak 178 | packages/flatpak/flatpak 179 | packages/flatpak/shared-modules 180 | packages/flatpak/.flatpak-builder 181 | 182 | # Ignore build dir 183 | /build/ 184 | 185 | # Launch app 186 | /src/launch-app/build/ 187 | /src/launch-app/.cache/ 188 | /src/launch-app/compile_flags.txt 189 | 190 | # Ignore any configs 191 | /config.json -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/launch-app/extern/boost"] 2 | path = src/launch-app/extern/boost 3 | url = https://github.com/boostorg/boost.git 4 | [submodule "src/launch-app/extern/traypp"] 5 | path = src/launch-app/extern/traypp 6 | url = https://github.com/gamingdoom/traypp.git 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Pranay Sanghai 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 9 |

Neutron

10 | 23 | 24 | # About Neutron 25 | 26 | Neutron is an open-source tool for creating desktop applications based on web applications. Neutron uses Gecko/Firefox under the hood. 27 | 28 | # Usage 29 | Neutron can be configured through the ``configurator.py`` configuration wizard. After being configured, ``config.json`` is generated in the build folder and ``build.py`` can be run to build your application. One example of a Neutron application is [Datcord](https://github.com/gamingdoom/datcord). More information can be found on the [wiki](https://github.com/gamingdoom/neutron/wiki). 30 | ## Making an application 31 | Currently, neutron applications can only be built on Linux. 32 | ``` 33 | git clone https://github.com/gamingdoom/neutron.git --recurse-submodules -j8 34 | cd neutron 35 | pip install -r requirements.txt 36 | python configurator.py 37 | cd build 38 | python build.py 39 | ``` 40 | # Why? 41 | Neutron is beneficial for the internet as a whole as it challenges the status quo of everything being Chromium based. If more people are able to use browsers other than Chromium, the internet will be freer since there will be no browser monoply. 42 | -------------------------------------------------------------------------------- /configurator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import json 3 | import re 4 | import os 5 | import shutil 6 | import sys 7 | import argparse 8 | 9 | parser = argparse.ArgumentParser( 10 | description='This program can guide you through the process of configuring Neutron.') 11 | 12 | parser.add_argument("-c", "--config-file", help="File path of the config JSON generated by a past run of this program.", required=False) 13 | parser.add_argument("-k", "--keep-build-dir", help="Don't clear the build folder.", required=False, action="store_true") 14 | 15 | def main(args: argparse.Namespace): 16 | if not args.config_file: 17 | appinfo = {} 18 | appinfo["appName"] = input("Enter the name of your application (example: Datcord):\n") 19 | appinfo["internalAppName"] = appinfo["appName"].replace(" ", "-").lower() 20 | appinfo["url"] = input("Please enter the URL of your application (example: https://discord.com/app):\n") 21 | appinfo["logoSvgFilePath"] = os.path.abspath(input("Please provide a path to a SVG of the application's logo (example: ../src/datcord.svg):\n")) 22 | while True: 23 | try: 24 | appinfo["platforms"] = json.loads('{"array":' + input('List of lowercase platform names to build for (example: ["linux", "appimage", "windows"]):\n') + "}")["array"] 25 | break 26 | except json.JSONDecodeError: 27 | print("Please enter the platforms in the same format as the example.") 28 | 29 | answer = input("Should any external extensions be installed? [y/n]") 30 | if answer == ("Y" or "y"): 31 | try: 32 | appinfo["extensionURLs"] = json.loads('{"array":' + input('List URLs of extensions to install (example: ["https://example.com/extension.zip"]):\n') + "}")["array"] 33 | except json.JSONDecodeError: 34 | appinfo["extensionURLs"] = [] 35 | 36 | appinfo["version"] = input("Enter the application version (example: 1.0.0):\n") 37 | appinfo["projectURL"] = input("Enter the URL to your project (example: https://github.com/gamingdoom/datcord):\n") 38 | appinfo["projectHelpURL"] = input("Enter the help URL for your project (example: https://github.com/gamingdoom/datcord/issues):\n") 39 | 40 | while True: 41 | answer = input("Allow links to open in the default browser? [y/n]\n") 42 | if answer == ("y" or "Y"): 43 | appinfo["openInDefaultBrowser"] = True 44 | if not shutil.which("web-ext"): 45 | print("web-ext missing! It must be installed to build support for opening links in the default browser.") 46 | exit(1) 47 | 48 | while True: 49 | appinfo["openInDefaultBrowserRegex"] = input("Please enter a regular expression that matches links that shouldn't open in the default browser (example: http[s]?://discord.com):\n") 50 | try: 51 | pattern = re.compile(appinfo["openInDefaultBrowserRegex"]) 52 | if not pattern.match(appinfo["url"]): 53 | print("The provided pattern matched the url of the application!") 54 | continue 55 | break 56 | except: 57 | print("Invalid regular expression!") 58 | continue 59 | break 60 | elif answer == ("n" or "N"): 61 | appinfo["openInDefaultBrowser"] = False 62 | break 63 | 64 | while True: 65 | answer = input("Should the app run in the background when closed? This would make it deliver notifications even when closed. [y/n]\n") 66 | if answer == ("y" or "Y"): 67 | appinfo["runInBackground"] = True 68 | break 69 | 70 | elif answer == ("n" or "N"): 71 | appinfo["runInBackground"] = False 72 | break 73 | 74 | else: 75 | with open(args.config_file, "r") as f: 76 | appinfo = json.load(f) 77 | 78 | if not args.keep_build_dir: 79 | if os.path.exists("build"): 80 | print("Clearing build folder!") 81 | shutil.rmtree("build") 82 | 83 | os.mkdir("build") 84 | 85 | shutil.copyfile("src/scripts/build.py", "build/build.py") 86 | shutil.copytree("src", "build/src", dirs_exist_ok=True) 87 | 88 | with open("build/config.json", "w") as f: 89 | json.dump(appinfo, f, indent=4) 90 | 91 | print("Done! Run build.py in the build directory to build.") 92 | 93 | return 94 | 95 | if __name__ == "__main__": 96 | args = parser.parse_args() 97 | main(args) 98 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pillow 2 | cairosvg -------------------------------------------------------------------------------- /src/branding-template/LICENSE: -------------------------------------------------------------------------------- 1 | These files are under the MPL 2, as below. However, please note that you 2 | are not granted any trademark rights or licenses to the trademarks of the 3 | Mozilla Foundation or any party, including without limitation the 4 | Firefox name or logo. 5 | 6 | For more information, see: https://www.mozilla.org/foundation/licensing/ 7 | 8 | This Source Code Form is subject to the terms of the Mozilla Public 9 | License, v. 2.0. If a copy of the MPL was not distributed with this 10 | file, You can obtain one at https://mozilla.org/MPL/2.0/. 11 | -------------------------------------------------------------------------------- /src/branding-template/PrivateBrowsing_150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/PrivateBrowsing_150.png -------------------------------------------------------------------------------- /src/branding-template/PrivateBrowsing_70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/PrivateBrowsing_70.png -------------------------------------------------------------------------------- /src/branding-template/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/background.png -------------------------------------------------------------------------------- /src/branding-template/branding.nsi: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | 5 | # NSIS branding defines for official release builds. 6 | # The nightly build branding.nsi is located in browser/installer/windows/nsis/ 7 | # The unofficial build branding.nsi is located in browser/branding/unofficial/ 8 | 9 | # BrandFullNameInternal is used for some registry and file system values 10 | # instead of BrandFullName and typically should not be modified. 11 | !define BrandFullNameInternal "NEUTRON_INTERNAL_APP_NAME" 12 | !define BrandFullName "NEUTRON_APP_NAME" 13 | !define CompanyName "NEUTRON_APP_NAME" 14 | !define URLInfoAbout "NEUTRON_PROJECT_URL" 15 | !define HelpLink "NEUTRON_PROJECT_HELP_URL" 16 | 17 | ; The OFFICIAL define is a workaround to support different urls for Release and 18 | ; Beta since they share the same branding when building with other branches that 19 | ; set the update channel to beta. 20 | !define OFFICIAL 21 | !define URLStubDownloadX86 "https://download.mozilla.org/?os=win&lang=${AB_CD}&product=firefox-latest" 22 | !define URLStubDownloadAMD64 "https://download.mozilla.org/?os=win64&lang=${AB_CD}&product=firefox-latest" 23 | !define URLStubDownloadAArch64 "https://download.mozilla.org/?os=win64-aarch64&lang=${AB_CD}&product=firefox-latest" 24 | !define URLManualDownload "https://www.mozilla.org/${AB_CD}/firefox/installer-help/?channel=release&installer_lang=${AB_CD}" 25 | !define URLSystemRequirements "https://www.mozilla.org/firefox/system-requirements/" 26 | !define Channel "release" 27 | 28 | # The installer's certificate name and issuer expected by the stub installer 29 | !define CertNameDownload "Mozilla Corporation" 30 | !define CertIssuerDownload "DigiCert SHA2 Assured ID Code Signing CA" 31 | 32 | # Dialog units are used so the UI displays correctly with the system's DPI 33 | # settings. These are tweaked to look good with the en-US strings; ideally 34 | # we would customize them for each locale but we don't really have a way to 35 | # implement that and it would be a ton of work for the localizers. 36 | !define PROFILE_CLEANUP_LABEL_TOP "50u" 37 | !define PROFILE_CLEANUP_LABEL_LEFT "22u" 38 | !define PROFILE_CLEANUP_LABEL_WIDTH "175u" 39 | !define PROFILE_CLEANUP_LABEL_HEIGHT "100u" 40 | !define PROFILE_CLEANUP_LABEL_ALIGN "left" 41 | !define PROFILE_CLEANUP_CHECKBOX_LEFT "22u" 42 | !define PROFILE_CLEANUP_CHECKBOX_WIDTH "175u" 43 | !define PROFILE_CLEANUP_BUTTON_LEFT "22u" 44 | !define INSTALL_HEADER_TOP "70u" 45 | !define INSTALL_HEADER_LEFT "22u" 46 | !define INSTALL_HEADER_WIDTH "180u" 47 | !define INSTALL_HEADER_HEIGHT "100u" 48 | !define INSTALL_BODY_LEFT "22u" 49 | !define INSTALL_BODY_WIDTH "180u" 50 | !define INSTALL_INSTALLING_TOP "115u" 51 | !define INSTALL_INSTALLING_LEFT "270u" 52 | !define INSTALL_INSTALLING_WIDTH "150u" 53 | !define INSTALL_PROGRESS_BAR_TOP "100u" 54 | !define INSTALL_PROGRESS_BAR_LEFT "270u" 55 | !define INSTALL_PROGRESS_BAR_WIDTH "150u" 56 | !define INSTALL_PROGRESS_BAR_HEIGHT "12u" 57 | 58 | !define PROFILE_CLEANUP_CHECKBOX_TOP_MARGIN "12u" 59 | !define PROFILE_CLEANUP_BUTTON_TOP_MARGIN "12u" 60 | !define PROFILE_CLEANUP_BUTTON_X_PADDING "80u" 61 | !define PROFILE_CLEANUP_BUTTON_Y_PADDING "8u" 62 | !define INSTALL_BODY_TOP_MARGIN "20u" 63 | 64 | # Font settings that can be customized for each channel 65 | !define INSTALL_HEADER_FONT_SIZE 20 66 | !define INSTALL_HEADER_FONT_WEIGHT 600 67 | !define INSTALL_INSTALLING_FONT_SIZE 15 68 | !define INSTALL_INSTALLING_FONT_WEIGHT 600 69 | 70 | # UI Colors that can be customized for each channel 71 | !define COMMON_TEXT_COLOR 0x000000 72 | !define COMMON_BACKGROUND_COLOR 0xFFFFFF 73 | !define INSTALL_INSTALLING_TEXT_COLOR 0xFFFFFF 74 | # This color is written as 0x00BBGGRR because it's actually a COLORREF value. 75 | !define PROGRESS_BAR_BACKGROUND_COLOR 0xFFAA00 76 | -------------------------------------------------------------------------------- /src/branding-template/configure.sh: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | 5 | 6 | MOZ_APP_NAME=NEUTRON_INTERNAL_APP_NAME 7 | MOZ_APP_BASENAME=NEUTRON_APP_NAME 8 | MOZ_APP_PROFILE=NEUTRON_INTERNAL_APP_NAME 9 | MOZ_APP_VENDOR=NEUTRON_APP_NAME 10 | MOZ_APP_DISPLAYNAME=NEUTRON_APP_NAME 11 | -------------------------------------------------------------------------------- /src/branding-template/content/about-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/content/about-logo.png -------------------------------------------------------------------------------- /src/branding-template/content/about-logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/branding-template/content/about-logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/content/about-logo@2x.png -------------------------------------------------------------------------------- /src/branding-template/content/about-wordmark.svg: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/branding-template/content/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/content/about.png -------------------------------------------------------------------------------- /src/branding-template/content/aboutDialog.css: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | #aboutDialogContainer { 6 | background-color: #20123a; 7 | color: #fff; 8 | } 9 | 10 | #clientBox { 11 | padding: 10px 0 15px; 12 | } 13 | 14 | #leftBox { 15 | background-image: url("chrome://branding/content/about-logo.png"); 16 | background-repeat: no-repeat; 17 | background-size: 192px auto; 18 | background-position: center 20%; 19 | /* min-width and min-height create room for the logo */ 20 | min-width: 210px; 21 | min-height: 210px; 22 | margin-top: 20px; 23 | margin-inline-start: 30px; 24 | } 25 | 26 | @media (min-resolution: 2dppx) { 27 | #leftBox { 28 | background-image: url("chrome://branding/content/about-logo@2x.png"); 29 | } 30 | } 31 | 32 | .text-link { 33 | color: #fff !important; 34 | text-decoration: underline; 35 | } 36 | 37 | .text-link:-moz-focusring { 38 | border-color: #fff; 39 | } 40 | 41 | #rightBox { 42 | margin-inline: 30px; 43 | } 44 | 45 | #bottomBox { 46 | background-color: hsla(235, 43%, 10%, .5); 47 | padding: 15px 10px 15px; 48 | } 49 | 50 | #trademark { 51 | font-size: xx-small; 52 | text-align: center; 53 | color: #999999; 54 | margin-block: 10px; 55 | } 56 | -------------------------------------------------------------------------------- /src/branding-template/content/aboutlogins.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/branding-template/content/firefox-wordmark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/branding-template/content/jar.mn: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | 5 | browser.jar: 6 | % content branding %content/branding/ contentaccessible=yes 7 | content/branding/about.png 8 | content/branding/about-logo.png 9 | content/branding/about-logo.svg 10 | content/branding/about-logo@2x.png 11 | content/branding/about-wordmark.svg 12 | content/branding/firefox-wordmark.svg 13 | content/branding/aboutlogins.svg 14 | content/branding/icon16.png (../default16.png) 15 | content/branding/icon32.png (../default32.png) 16 | content/branding/icon48.png (../default48.png) 17 | content/branding/icon64.png (../default64.png) 18 | content/branding/icon128.png (../default128.png) 19 | content/branding/aboutDialog.css 20 | -------------------------------------------------------------------------------- /src/branding-template/content/moz.build: -------------------------------------------------------------------------------- 1 | # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- 2 | # vim: set filetype=python: 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | JAR_MANIFESTS += ["jar.mn"] 8 | -------------------------------------------------------------------------------- /src/branding-template/disk.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/disk.icns -------------------------------------------------------------------------------- /src/branding-template/document.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/document.icns -------------------------------------------------------------------------------- /src/branding-template/document.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/document.ico -------------------------------------------------------------------------------- /src/branding-template/document_pdf.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/document_pdf.ico -------------------------------------------------------------------------------- /src/branding-template/dsstore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/dsstore -------------------------------------------------------------------------------- /src/branding-template/firefox.VisualElementsManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /src/branding-template/locales/en-US/brand.dtd: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /src/branding-template/locales/en-US/brand.ftl: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | 5 | ## Firefox and Mozilla Brand 6 | ## 7 | ## Firefox and Mozilla must be treated as a brand. 8 | ## 9 | ## They cannot be: 10 | ## - Transliterated. 11 | ## - Translated. 12 | ## 13 | ## Declension should be avoided where possible, leaving the original 14 | ## brand unaltered in prominent UI positions. 15 | ## 16 | ## For further details, consult: 17 | ## https://mozilla-l10n.github.io/styleguides/mozilla_general/#brands-copyright-and-trademark 18 | 19 | -brand-shorter-name = NEUTRON_APP_NAME 20 | -brand-short-name = NEUTRON_APP_NAME 21 | -brand-full-name = NEUTRON_APP_NAME 22 | # This brand name can be used in messages where the product name needs to 23 | # remain unchanged across different versions (Nightly, Beta, etc.). 24 | -brand-product-name = NEUTRON_APP_NAME 25 | -vendor-short-name = NEUTRON_APP_NAME 26 | trademarkInfo = { " " } 27 | -------------------------------------------------------------------------------- /src/branding-template/locales/en-US/brand.properties: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | 5 | brandShorterName=NEUTRON_APP_NAME 6 | brandShortName=NEUTRON_APP_NAME 7 | brandFullName=NEUTRON_APP_NAME 8 | # LOCALIZATION NOTE(brandProductName): 9 | # This brand name can be used in messages where the product name needs to 10 | # remain unchanged across different versions (Nightly, Beta, etc.). 11 | brandProductName=NEUTRON_APP_NAME 12 | vendorShortName=NEUTRON_APP_NAME 13 | -------------------------------------------------------------------------------- /src/branding-template/locales/jar.mn: -------------------------------------------------------------------------------- 1 | #filter substitution 2 | # This Source Code Form is subject to the terms of the Mozilla Public 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | [localization] @AB_CD@.jar: 7 | branding (%*.ftl) 8 | 9 | @AB_CD@.jar: 10 | % locale branding @AB_CD@ %locale/branding/ 11 | locale/branding/brand.dtd (%brand.dtd) 12 | locale/branding/brand.properties (%brand.properties) 13 | -------------------------------------------------------------------------------- /src/branding-template/locales/moz.build: -------------------------------------------------------------------------------- 1 | # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- 2 | # vim: set filetype=python: 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | JAR_MANIFESTS += ["jar.mn"] 8 | -------------------------------------------------------------------------------- /src/branding-template/moz.build: -------------------------------------------------------------------------------- 1 | # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- 2 | # vim: set filetype=python: 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | DIRS += ['content', 'locales'] 8 | 9 | DIST_SUBDIR = 'browser' 10 | export('DIST_SUBDIR') 11 | 12 | include('../branding-common.mozbuild') 13 | FirefoxBranding() 14 | -------------------------------------------------------------------------------- /src/branding-template/msix/Assets/Document44x44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/msix/Assets/Document44x44.png -------------------------------------------------------------------------------- /src/branding-template/msix/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/msix/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /src/branding-template/newtab.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/newtab.ico -------------------------------------------------------------------------------- /src/branding-template/newwindow.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/newwindow.ico -------------------------------------------------------------------------------- /src/branding-template/pbmode.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/pbmode.ico -------------------------------------------------------------------------------- /src/branding-template/pref/firefox-branding.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | // open links in default browser 6 | pref("network.protocol-handler.external.open", true); 7 | pref("network.protocol-handler.warn-external.open", true); 8 | pref("network.protocol-handler.expose.open", false); 9 | 10 | pref("permissions.default.camera", 1); 11 | pref("permissions.default.microphone", 1); 12 | 13 | pref("browser.link.open_newwindow", 1); 14 | pref("browser.warnOnQuit", false); 15 | pref("browser.uitour.enabled", false); 16 | pref("browser.privatebrowsing.vpnpromourl", ""); 17 | pref("browser.tabs.inTitlebar", 0); 18 | 19 | pref("browser.startup.upgradeDialog.enabled", false); 20 | pref("browser.startup.firstrunSkipsHomepage", false); 21 | pref("browser.startup.page", 1); 22 | pref("browser.startup.homepage", "NEUTRON_APP_URL"); 23 | 24 | pref("browser.shell.setDefaultPDFHandler", false); 25 | pref("browser.shell.setDefaultBrowserUserChoice", false); 26 | pref("browser.shell.checkDefaultBrowser", false); 27 | pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", true); 28 | #ifdef XP_WIN 29 | pref("default-browser-agent.enabled", false); 30 | #endif 31 | 32 | pref("browser.urlbar.suggest.bookmark", false); 33 | pref("browser.urlbar.suggest.history", false); 34 | pref("browser.urlbar.suggest.openpage", false); 35 | pref("browser.urlbar.suggest.remotetab", false); 36 | pref("browser.urlbar.suggest.searches", false); 37 | pref("browser.urlbar.suggest.topsites", false); 38 | pref("browser.urlbar.suggest.engines", false); 39 | 40 | pref("xpinstall.signatures.required", false); 41 | 42 | // Don't show session restore page 43 | pref("browser.sessionstore.max_tabs_undo", 0); 44 | pref("browser.sessionstore.max_windows_undo", 0); 45 | pref("browser.sessionstore.max_resumed_crashes", 0); 46 | pref("browser.sessionstore.resume_from_crash", false); 47 | pref("browser.sessionstore.collect_session_storage", false); 48 | pref("browser.sessionstore.restore_on_demand", false); 49 | pref("browser.startup.couldRestoreSession.count", -1); 50 | -------------------------------------------------------------------------------- /src/branding-template/private_browsing.VisualElementsManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 12 | -------------------------------------------------------------------------------- /src/branding-template/stubinstaller/bgstub.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/stubinstaller/bgstub.jpg -------------------------------------------------------------------------------- /src/branding-template/stubinstaller/installing_page.css: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | body { 6 | color: black; 7 | } 8 | 9 | /* 10 | * We want to treat the two pieces of text in the left column as one unit and 11 | center that unit vertically in the window. In order to make IE8 do that, 12 | we have to wrap the two bits of text in a container and make that a 13 | table-cell (which means we need an outer container that's display: table). 14 | So that's what this mess is doing. 15 | */ 16 | #text_column { 17 | position: fixed; 18 | height: 100%; 19 | margin-left: 30px; 20 | width: 40%; 21 | display: table; 22 | } 23 | 24 | #text_column_container { 25 | display: table-cell; 26 | vertical-align: middle; 27 | padding-top: 60px; 28 | } 29 | 30 | #header { 31 | font-size: 24px; 32 | font-weight: 800; 33 | margin-top: 0; 34 | } 35 | 36 | #content { 37 | font-size: 22px; 38 | } 39 | 40 | #installing { 41 | position: fixed; 42 | right: 30px; 43 | bottom: 55%; 44 | margin-top: auto; 45 | margin-bottom: auto; 46 | width: 35%; 47 | } 48 | 49 | #label { 50 | color: white; 51 | 52 | position: relative; 53 | top: 50px; 54 | 55 | text-align: center; 56 | font-size: 20px; 57 | } 58 | 59 | #progress_background { 60 | width: 100%; 61 | height: 20px; 62 | background-color: white; 63 | } 64 | 65 | body.high-contrast #progress_background { 66 | outline: solid; 67 | } 68 | 69 | #progress_bar { 70 | margin: 0; 71 | width: 0%; 72 | height: 100%; 73 | background-color: #00AAFF; 74 | } 75 | 76 | /* In high contrast mode, fill the entire progress bar with its border. */ 77 | body.high-contrast #progress_bar { 78 | /* This border should be the height of progress_background. */ 79 | border-top: 20px solid; 80 | box-sizing: border-box; 81 | } 82 | 83 | /* No blurb or footer for this layout. */ 84 | #blurb, 85 | #footer { 86 | visibility: hidden; 87 | } 88 | -------------------------------------------------------------------------------- /src/branding-template/stubinstaller/profile_cleanup_page.css: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | body { 6 | color: black; 7 | } 8 | 9 | /* 10 | * We want to treat the two pieces of text in the left column as one unit and 11 | center that unit vertically in the window. In order to make IE8 do that, 12 | we have to wrap the two bits of text in a container and make that a 13 | table-cell (which means we need an outer container that's display: table). 14 | So that's what this mess is doing. 15 | */ 16 | #profileRefreshForm { 17 | position: fixed; 18 | height: 100%; 19 | margin-left: 30px; 20 | width: 40%; 21 | display: table; 22 | } 23 | 24 | #profileRefreshContainer { 25 | display: table-cell; 26 | vertical-align: middle; 27 | } 28 | 29 | #refreshCheckboxContainer, 30 | #refreshButtonContainer { 31 | margin-top: 20px; 32 | } 33 | 34 | #header { 35 | font-size: 25px; 36 | font-weight: 600; 37 | } 38 | 39 | #refreshCheckboxContainer { 40 | position: relative; 41 | } 42 | 43 | #refreshCheckbox { 44 | position: absolute; 45 | top: 1px; 46 | } 47 | 48 | #checkboxLabel { 49 | font-size: 14px; 50 | display: block; 51 | } 52 | 53 | .checkboxLabel-ltr { 54 | margin-left: 25px; 55 | } 56 | 57 | .checkboxLabel-rtl { 58 | margin-right: 25px; 59 | } 60 | 61 | #refreshButton { 62 | padding: 8px 70px; 63 | font-size: 16px; 64 | background: #005ccc; 65 | color: white; 66 | } 67 | 68 | body.normal-contrast #refreshButton { 69 | border: none; 70 | } 71 | 72 | /* No footer for this layout. */ 73 | #footer { 74 | visibility: hidden; 75 | } 76 | -------------------------------------------------------------------------------- /src/branding-template/wizHeader.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/wizHeader.bmp -------------------------------------------------------------------------------- /src/branding-template/wizHeaderRTL.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/wizHeaderRTL.bmp -------------------------------------------------------------------------------- /src/branding-template/wizWatermark.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamingdoom/neutron/247031503abd707c0c6dbc28ecc6465c3fbf649a/src/branding-template/wizWatermark.bmp -------------------------------------------------------------------------------- /src/changed/browser/themes/linux/browser.css: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | @import url("chrome://browser/skin/browser-shared.css"); 6 | @import url("chrome://browser/skin/contextmenu.css"); 7 | 8 | @namespace html url("http://www.w3.org/1999/xhtml"); 9 | 10 | /** 11 | * We intentionally do not include browser-custom-colors.css, 12 | * instead choosing to fall back to system colours and transparencies 13 | * in order to accomodate the wider variety of system themes on that 14 | * platform. 15 | */ 16 | 17 | /* Neutron stuff. remove unwanted ui like tabs and url bar */ 18 | #TabsToolbar { visibility: collapse !important; } 19 | #navigator-toolbox .browser-toolbar { height: 0px !important; min-height: 0px !important; } 20 | 21 | :root { 22 | --toolbar-non-lwt-bgcolor: color-mix(in srgb, -moz-dialog 85%, white); 23 | --toolbar-non-lwt-textcolor: -moz-dialogtext; 24 | 25 | --chrome-content-separator-color: ThreeDShadow; 26 | } 27 | 28 | #TabsToolbar:not(:-moz-lwtheme), 29 | #TabsToolbar[brighttext]:not(:-moz-lwtheme) { 30 | --tab-attention-icon-color: AccentColor; 31 | } 32 | 33 | :root:-moz-lwtheme { 34 | --chrome-content-separator-color: rgba(0,0,0,.3); 35 | } 36 | 37 | #menubar-items { 38 | -moz-box-orient: vertical; /* for flex hack */ 39 | } 40 | 41 | #navigator-toolbox { 42 | appearance: none; 43 | background-color: transparent; 44 | border-top: none; 45 | border-bottom: 0px !important; 46 | } 47 | 48 | .browser-toolbar { 49 | padding: 0; 50 | } 51 | 52 | .browser-toolbar:not(.titlebar-color) { 53 | background-color: var(--toolbar-bgcolor); 54 | color: var(--toolbar-color); 55 | appearance: none; 56 | border-style: none; 57 | } 58 | 59 | #nav-bar:not([tabs-hidden="true"]) { 60 | box-shadow: 0 calc(-1 * var(--tabs-navbar-shadow-size)) 0 var(--lwt-tabs-border-color, rgba(0,0,0,.3)); 61 | /* This is needed for some toolbar button animations. Gross :( */ 62 | position: relative; 63 | } 64 | 65 | /* Bookmark menus */ 66 | menu.bookmark-item, 67 | menuitem.bookmark-item { 68 | min-width: 0; 69 | max-width: 32em; 70 | } 71 | 72 | .bookmark-item:not(.subviewbutton) > .menu-iconic-left { 73 | margin-block: 0; 74 | } 75 | 76 | /* Bookmark drag and drop styles */ 77 | .bookmark-item[dragover-into="true"] { 78 | background: SelectedItem !important; 79 | color: SelectedItemText !important; 80 | } 81 | 82 | .bookmark-item[cutting] > .toolbarbutton-icon, 83 | .bookmark-item[cutting] > .menu-iconic-left > .menu-iconic-icon { 84 | opacity: 0.5; 85 | } 86 | 87 | .bookmark-item[cutting] > .toolbarbutton-text, 88 | .bookmark-item[cutting] > .menu-iconic-left > .menu-iconic-text { 89 | opacity: 0.7; 90 | } 91 | 92 | /* Address bar */ 93 | #urlbar, 94 | #searchbar { 95 | font-size: 1.05em; 96 | } 97 | 98 | @supports -moz-bool-pref("browser.urlbar.experimental.expandTextOnFocus") { 99 | #urlbar[breakout-extend] { 100 | font-size: 1.14em; 101 | } 102 | } 103 | 104 | :root { 105 | --toolbar-field-border-color: ThreeDShadow; 106 | } 107 | 108 | /* Address bar results view */ 109 | 110 | :root:not(:-moz-lwtheme) { 111 | --urlbar-popup-action-color: -moz-nativehyperlinktext; 112 | --autocomplete-popup-highlight-background: SelectedItem; 113 | --autocomplete-popup-highlight-color: SelectedItemText; 114 | } 115 | 116 | /* AutoComplete */ 117 | 118 | #PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] { 119 | border-top: 1px solid ThreeDShadow; 120 | } 121 | 122 | /* Content area */ 123 | 124 | 125 | #browser { 126 | --sidebar-border-color: ThreeDShadow; 127 | } 128 | 129 | .sidebar-splitter { 130 | appearance: none; 131 | width: 6px; 132 | background-color: -moz-dialog; 133 | border: 1px ThreeDShadow; 134 | border-style: none solid; 135 | } 136 | 137 | /* Tabstrip */ 138 | 139 | #tabbrowser-tabs { 140 | /* override the global style to allow the selected tab to be above the nav-bar */ 141 | z-index: auto; 142 | } 143 | 144 | #TabsToolbar { 145 | min-height: 0; 146 | } 147 | 148 | #TabsToolbar:not(:-moz-lwtheme) { 149 | appearance: auto; 150 | -moz-default-appearance: menubar; 151 | color: -moz-menubartext; 152 | } 153 | 154 | #context_reloadTab { 155 | list-style-image: url("moz-icon://stock/gtk-refresh?size=menu"); 156 | } 157 | 158 | #context_closeOtherTabs { 159 | list-style-image: url("moz-icon://stock/gtk-clear?size=menu"); 160 | } 161 | 162 | #context_closeOtherTabs[disabled] { 163 | list-style-image: url("moz-icon://stock/gtk-clear?size=menu&state=disabled"); 164 | } 165 | 166 | #context_undoCloseTab { 167 | list-style-image: url("moz-icon://stock/gtk-undelete?size=menu"); 168 | } 169 | 170 | #context_closeTab { 171 | list-style-image: url("moz-icon://stock/gtk-close?size=menu"); 172 | } 173 | 174 | /* All tabs menupopup */ 175 | 176 | .alltabs-item[selected="true"] { 177 | font-weight: bold; 178 | } 179 | 180 | /* Status panel */ 181 | 182 | #statuspanel-label { 183 | margin: 0; 184 | padding: 2px 4px; 185 | background-color: -moz-dialog; 186 | border: 1px none ThreeDShadow; 187 | border-top-style: solid; 188 | color: -moz-dialogText; 189 | text-shadow: none; 190 | color-scheme: light; 191 | } 192 | 193 | @media (-moz-content-prefers-color-scheme: dark) { 194 | #statuspanel-label { 195 | color-scheme: dark; 196 | } 197 | } 198 | 199 | #statuspanel:not([mirror]) > #statuspanel-label:-moz-locale-dir(ltr), 200 | #statuspanel[mirror] > #statuspanel-label:-moz-locale-dir(rtl) { 201 | border-right-style: solid; 202 | border-top-right-radius: .3em; 203 | margin-right: 1em; 204 | } 205 | 206 | #statuspanel:not([mirror]) > #statuspanel-label:-moz-locale-dir(rtl), 207 | #statuspanel[mirror] > #statuspanel-label:-moz-locale-dir(ltr) { 208 | border-left-style: solid; 209 | border-top-left-radius: .3em; 210 | margin-left: 1em; 211 | } 212 | 213 | 214 | #UITourHighlight { 215 | /* Below are some fixes for people without an X compositor on Linux. 216 | This is why we can't have nice things: */ 217 | /* Animations don't repaint properly without an X compositor. */ 218 | animation-name: none !important; 219 | /* Opacity rounds to 0 or 1 on Linux without an X compositor, making the 220 | background color not visible. Anti-aliasing is not available either. Make a 221 | thicker outline and cancel border-radius for that case. */ 222 | outline: 4px solid rgb(0,200,215); 223 | border-radius: 0 !important; 224 | } 225 | 226 | #UITourTooltipDescription { 227 | font-size: 1.05rem; 228 | } 229 | 230 | #UITourTooltipClose { 231 | margin-inline-end: -4px; 232 | } 233 | 234 | /** 235 | * Override the --arrowpanel-padding so the background extends 236 | * to the sides and bottom of the panel. 237 | */ 238 | #UITourTooltipButtons { 239 | margin-inline-start: -10px; 240 | margin-bottom: -10px; 241 | } 242 | 243 | #context-navigation > .menuitem-iconic > .menu-iconic-left { 244 | /* override toolkit/themes/linux/global/menu.css */ 245 | padding-inline-end: 0 !important; 246 | margin-inline-end: 0 !important; 247 | } 248 | 249 | /** 250 | * Titlebar drawing: 251 | * 252 | * We draw to titlebar when Gkt+ CSD is available. This is mostly 253 | * straight-forward, but getting the window corners to look perfect is a bit 254 | * tricky, as there are different variables to take into account. 255 | * 256 | * GTK windows have both a window radius (exposed via the 257 | * `-moz-gtk-csd-titlebar-radius`) environment variable, and a window shadow 258 | * (which we can't read back from GTK). Note that the native drawing does draw 259 | * the shadow already. 260 | * 261 | * So there are multiple configurations to consider: 262 | * 263 | * * Whether we're using Wayland vs. X11 264 | * * Whether we're using a lightweight theme or not. 265 | * 266 | * Consider the simple case (default system theme). We render the titlebar 267 | * using `-moz-default-appearance: -moz-window-titlebar;`, then don't draw 268 | * anything else. Success! 269 | * 270 | * Now consider lightweight themes: We need to render the native titlebar 271 | * behind the "theme" titlebar in order to render the native shadow on X11. But 272 | * we can't just use the #navigator-toolbox as that's where the lightweight 273 | * theme background goes, so we need to use the #navigator-toolbox-background. 274 | * We still have to apply the corner radii to #navigator-toolbox of course, so 275 | * the lightweight theme background doesn't overflow the titlebar radius. 276 | * 277 | * In a Wayland-only world, the setup could be much simpler: We could apply the 278 | * titlebar appearance to #navigator-toolbox, and just apply the border radius 279 | * on the or #navigator-toolbox-background to clip the extra shadow when 280 | * using the system theme. For the lightweight theme, we could use 281 | * appearance: none and the titlebar radius on the toolbox. In X11 however, we 282 | * do need the native titlebar behind at all times. 283 | */ 284 | @media (-moz-gtk-csd-available) { 285 | :root[tabsintitlebar][sizemode="normal"] { 286 | background-color: transparent; 287 | } 288 | 289 | :root[tabsintitlebar] #titlebar { 290 | color: CaptionText; 291 | } 292 | 293 | :root[tabsintitlebar] #titlebar:-moz-window-inactive { 294 | color: InactiveCaptionText; 295 | } 296 | 297 | :root[tabsintitlebar] #titlebar:-moz-lwtheme { 298 | color: inherit; 299 | } 300 | 301 | :root[tabsintitlebar] #navigator-toolbox-background { 302 | appearance: auto; 303 | -moz-default-appearance: -moz-window-titlebar-maximized; 304 | } 305 | 306 | :root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) #navigator-toolbox-background { 307 | -moz-default-appearance: -moz-window-titlebar; 308 | } 309 | 310 | :root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) #navigator-toolbox:-moz-lwtheme, 311 | :root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) dialog::backdrop { 312 | border-top-left-radius: env(-moz-gtk-csd-titlebar-radius); 313 | border-top-right-radius: env(-moz-gtk-csd-titlebar-radius); 314 | } 315 | 316 | /* When temporarily showing the menu bar, make it at least as tall as the tab 317 | * bar such that the window controls don't appear to move up. */ 318 | :root[tabsintitlebar] #toolbar-menubar[autohide="true"] { 319 | height: calc(var(--tab-min-height) + 2 * var(--tab-block-margin)); 320 | } 321 | 322 | /* Make #TabsToolbar transparent as we style underlying #titlebar with 323 | * -moz-window-titlebar (Gtk+ theme). */ 324 | :root[tabsintitlebar] #TabsToolbar, 325 | :root[tabsintitlebar] #toolbar-menubar { 326 | appearance: none; 327 | color: inherit; 328 | } 329 | 330 | :root[tabsintitlebar] #main-menubar { 331 | color: inherit; 332 | } 333 | 334 | /* The button box must appear on top of the navigator-toolbox in order for 335 | * click and hover mouse events to work properly for the button in the restored 336 | * window state. Otherwise, elements in the navigator-toolbox, like the menubar, 337 | * can swallow those events. */ 338 | .titlebar-buttonbox { 339 | z-index: 1; 340 | -moz-box-align: center; 341 | } 342 | 343 | /* Render titlebar command buttons according to system config. 344 | * Use full scale icons here as the Gtk+ does. */ 345 | .titlebar-min { 346 | appearance: auto; 347 | -moz-default-appearance: -moz-window-button-minimize; 348 | -moz-box-ordinal-group: env(-moz-gtk-csd-minimize-button-position); 349 | } 350 | .titlebar-max { 351 | appearance: auto; 352 | -moz-default-appearance: -moz-window-button-maximize; 353 | -moz-box-ordinal-group: env(-moz-gtk-csd-maximize-button-position); 354 | } 355 | .titlebar-restore { 356 | appearance: auto; 357 | -moz-default-appearance: -moz-window-button-restore; 358 | -moz-box-ordinal-group: env(-moz-gtk-csd-maximize-button-position); 359 | } 360 | .titlebar-close { 361 | appearance: auto; 362 | -moz-default-appearance: -moz-window-button-close; 363 | -moz-box-ordinal-group: env(-moz-gtk-csd-close-button-position); 364 | } 365 | 366 | /* When using lightweight themes, use our own buttons since native ones might 367 | * assume a native background in order to be visible. */ 368 | .titlebar-button:-moz-lwtheme { 369 | appearance: none; 370 | border-radius: 100%; 371 | } 372 | .titlebar-button > .toolbarbutton-icon:-moz-lwtheme { 373 | padding: 6px; 374 | -moz-context-properties: stroke; 375 | stroke: currentColor; 376 | } 377 | .titlebar-min:-moz-lwtheme { 378 | list-style-image: url(chrome://browser/skin/window-controls/minimize.svg); 379 | } 380 | .titlebar-max:-moz-lwtheme { 381 | list-style-image: url(chrome://browser/skin/window-controls/maximize.svg); 382 | } 383 | .titlebar-restore:-moz-lwtheme { 384 | list-style-image: url(chrome://browser/skin/window-controls/restore.svg); 385 | } 386 | .titlebar-close:-moz-lwtheme { 387 | list-style-image: url(chrome://browser/skin/window-controls/close.svg); 388 | } 389 | .titlebar-button:-moz-lwtheme:hover { 390 | background-color: color-mix(in srgb, currentColor 12%, transparent); 391 | } 392 | .titlebar-button:-moz-lwtheme:hover:active { 393 | background-color: color-mix(in srgb, currentColor 20%, transparent); 394 | } 395 | .titlebar-close:-moz-lwtheme:hover { 396 | background-color: #d70022; 397 | color: white; 398 | } 399 | .titlebar-close:-moz-lwtheme:hover:active { 400 | background-color: #ff0039; 401 | } 402 | 403 | @media not (-moz-gtk-csd-minimize-button) { 404 | .titlebar-min { 405 | display: none; 406 | } 407 | } 408 | @media not (-moz-gtk-csd-maximize-button) { 409 | .titlebar-restore, 410 | .titlebar-max { 411 | display: none; 412 | } 413 | } 414 | @media not (-moz-gtk-csd-close-button) { 415 | .titlebar-close { 416 | display: none; 417 | } 418 | } 419 | 420 | @media (-moz-gtk-csd-reversed-placement) { 421 | .titlebar-buttonbox-container { 422 | -moz-box-ordinal-group: 0; 423 | } 424 | } 425 | } 426 | -------------------------------------------------------------------------------- /src/changed/browser/themes/linux/webRTC-indicator.css: -------------------------------------------------------------------------------- 1 | %if 0 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 | %endif 6 | 7 | @namespace html url("http://www.w3.org/1999/xhtml"); 8 | 9 | %include ../shared/webRTC-indicator.inc.css 10 | -------------------------------------------------------------------------------- /src/changed/browser/themes/osx/browser.css: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | @import url("chrome://browser/skin/browser-shared.css"); 6 | @import url("chrome://browser/skin/browser-custom-colors.css"); 7 | 8 | @namespace html url("http://www.w3.org/1999/xhtml"); 9 | 10 | /* Neutron stuff. remove unwanted ui like tabs and url bar */ 11 | #TabsToolbar { visibility: collapse !important; } 12 | #navigator-toolbox .browser-toolbar { height: 0px !important; min-height: 0px !important; } 13 | 14 | :root { 15 | --arrowpanel-field-background: light-dark(rgba(249, 249, 250, .3), rgba(12, 12, 13, .3)); 16 | } 17 | 18 | #browser, 19 | #navigator-toolbox { 20 | /* #browser and #navigator-toolbox must have relative positions so that the 21 | latter can slide over the former in fullscreen mode. */ 22 | position: relative; 23 | } 24 | 25 | /** Begin titlebar **/ 26 | 27 | #titlebar { 28 | /* Centrally align content items vertically */ 29 | justify-content: center; 30 | } 31 | 32 | .titlebar-button { 33 | display: none; 34 | } 35 | 36 | .titlebar-buttonbox-container { 37 | align-items: center; 38 | /* Hide window controls in fullscreen */ 39 | :root[inFullscreen] & { 40 | display: none; 41 | } 42 | } 43 | 44 | .titlebar-buttonbox { 45 | &:-moz-locale-dir(ltr) { 46 | margin-inline: 12px 0; 47 | 48 | @media (-moz-mac-rtl) { 49 | margin-inline: 12px; 50 | } 51 | } 52 | 53 | &:-moz-locale-dir(rtl) { 54 | margin-inline: 12px; 55 | 56 | @media (-moz-mac-rtl) { 57 | margin-inline: 12px 0; 58 | } 59 | } 60 | } 61 | 62 | /** End titlebar **/ 63 | 64 | :root[chromehidden~="toolbar"][chromehidden~="location"][chromehidden~="directories"] { 65 | border-top: 1px solid rgba(0,0,0,0.65); 66 | } 67 | 68 | /* ----- BOOKMARK TOOLBAR ----- */ 69 | 70 | #nav-bar-customization-target > #wrapper-personal-bookmarks > #personal-bookmarks { 71 | min-height: 32px; 72 | align-items: center; 73 | } 74 | 75 | /* Workaround for native menubar inheritance */ 76 | .openintabs-menuitem { 77 | list-style-image: none; 78 | } 79 | 80 | .bookmark-item { 81 | > .menu-iconic-left > .menu-iconic-icon { 82 | width: 16px; 83 | height: 16px; 84 | } 85 | 86 | &[cutting] { 87 | > .toolbarbutton-icon, 88 | > .menu-iconic-left > .menu-iconic-icon { 89 | opacity: 0.5; 90 | } 91 | 92 | > .toolbarbutton-text, 93 | > .menu-iconic-left > .menu-iconic-text { 94 | opacity: 0.7; 95 | } 96 | } 97 | } 98 | 99 | /* ----- BOOKMARK MENUS ----- */ 100 | 101 | #bookmarksToolbarFolderMenu, 102 | #BMB_bookmarksToolbar, 103 | #panelMenu_bookmarksToolbar { 104 | list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.svg"); 105 | } 106 | 107 | /* Inactive elements are faded out on OSX */ 108 | .toolbarbutton-1:not(:hover):-moz-window-inactive, 109 | .bookmark-item:not(:hover):-moz-window-inactive, 110 | :root:not([customizing]) .toolbarbutton-1:-moz-window-inactive[disabled="true"] { 111 | opacity: 0.5; 112 | } 113 | 114 | /* Address bar */ 115 | 116 | @media (prefers-contrast) { 117 | /* The "increase contrast" preference on macOS draws a 1px black line around 118 | panels, including the separate search bar. Since the Urlbar is not 119 | implemented as a panel, it does not get this outline. This outline rule 120 | resembles the system outline, bringing the Urlbar in line with panels and 121 | other Mac apps. */ 122 | #urlbar[open] > #urlbar-background { 123 | outline: 1px solid var(--focus-outline-color) 124 | } 125 | } 126 | 127 | #urlbar, 128 | #searchbar { 129 | font-size: 1.25em; 130 | } 131 | 132 | /* stylelint-disable-next-line media-query-no-invalid */ 133 | @media (-moz-bool-pref: "browser.urlbar.experimental.expandTextOnFocus") { 134 | #urlbar[breakout-extend] { 135 | font-size: 1.36em; 136 | } 137 | } 138 | 139 | /* Move the margin to the parent element to properly position the ::after badge */ 140 | moz-input-box > menupopup .context-menu-add-engine > .menu-iconic-left { 141 | margin-inline: 0 5px; 142 | 143 | > .menu-iconic-icon { 144 | margin-inline: 0; 145 | } 146 | } 147 | 148 | /* ----- AUTOCOMPLETE ----- */ 149 | 150 | #PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] { 151 | border-top: 1px solid #C7C7C7; 152 | } 153 | 154 | /* Bookmarking panel */ 155 | 156 | /* The following elements come from editBookmarkPanel.inc.xhtml. Styling that's 157 | specific to the editBookmarkPanel should be in browser.css. Styling that 158 | should be shared by all editBookmarkPanel.inc.xhtml consumers should be in 159 | editBookmark.css. */ 160 | 161 | /**** folder tree and tag selector ****/ 162 | 163 | #editBMPanel_folderTree, 164 | #editBMPanel_tagsSelector { 165 | appearance: none; 166 | background-color: var(--arrowpanel-field-background); 167 | color: inherit; 168 | border-radius: 2px; 169 | border: 1px solid var(--panel-separator-color); 170 | margin: 0; 171 | } 172 | 173 | #editBMPanel_folderTree > treechildren::-moz-tree-row(blur,selected), 174 | #editBMPanel_tagsSelector:not(:focus) > richlistitem[selected] { 175 | background-color: var(--arrowpanel-dimmed); 176 | } 177 | 178 | #editBMPanel_folderTree > treechildren::-moz-tree-twisty(blur,selected), 179 | #editBMPanel_folderTree > treechildren::-moz-tree-image(blur,selected), 180 | #editBMPanel_folderTree > treechildren::-moz-tree-cell-text(blur,selected), 181 | #editBMPanel_tagsSelector:not(:focus) > richlistitem[selected] { 182 | color: inherit; 183 | } 184 | 185 | #editBMPanel_folderTree { 186 | border-bottom: none; 187 | border-end-start-radius: 0; 188 | border-end-end-radius: 0; 189 | /* Implements editBookmarkPanel resizing on folderTree un-collapse. */ 190 | margin: 0 !important; 191 | min-width: 27em; 192 | position: relative; 193 | } 194 | 195 | /* ----- SIDEBAR ELEMENTS ----- */ 196 | 197 | #sidebar-box { 198 | /* Default font size is 11px on mac, so this is 12px */ 199 | font-size: 1.0909rem; 200 | } 201 | 202 | /* ::::: tabbrowser ::::: */ 203 | 204 | #tabbrowser-tabbox { 205 | margin: 0; 206 | } 207 | 208 | .tab-label { 209 | margin-block: 1px 0; 210 | } 211 | 212 | .tabbrowser-tab:not(:hover) > .tab-stack > .tab-content > .tab-icon-image:not([selected], [multiselected]) { 213 | opacity: .9; 214 | } 215 | 216 | /* 217 | * Force the overlay to create a new stacking context so it always appears on 218 | * top of the icon. 219 | */ 220 | .tab-icon-overlay { 221 | opacity: 0.9999; 222 | } 223 | 224 | .tab-label-container:not([selected], [multiselected]) { 225 | opacity: .7; 226 | } 227 | 228 | .tabbrowser-tab { 229 | font: message-box; 230 | border: none; 231 | 232 | /* FIXME: Are these styles really needed nowadays? */ 233 | &:is([visuallyselected], [multiselected]) { 234 | /* overriding tabbox.css */ 235 | text-shadow: inherit; 236 | 237 | @media (prefers-color-scheme: light) { 238 | &:not(:-moz-lwtheme) { 239 | /* overriding tabbox.css */ 240 | color: hsl(240, 5%, 5%); 241 | } 242 | } 243 | } 244 | } 245 | 246 | #tabbrowser-tabs { 247 | /* overriding tabbox.css */ 248 | align-items: stretch; 249 | margin-bottom: 0; 250 | position: static; 251 | z-index: auto; 252 | } 253 | 254 | /* Bookmark drag and drop styles */ 255 | 256 | .bookmark-item[dragover-into="true"] { 257 | background: SelectedItem !important; 258 | color: SelectedItemText !important; 259 | } 260 | 261 | #UITourTooltipDescription { 262 | font-size: 1.18rem; 263 | line-height: 2rem; 264 | } 265 | 266 | #UITourTooltipClose { 267 | margin-inline-end: -10px; 268 | margin-top: -14px; 269 | } -------------------------------------------------------------------------------- /src/changed/browser/themes/osx/webRTC-indicator.css: -------------------------------------------------------------------------------- 1 | %if 0 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 | %endif 6 | 7 | @namespace html url("http://www.w3.org/1999/xhtml"); 8 | 9 | %include ../shared/webRTC-indicator.inc.css 10 | 11 | /** 12 | * On macOS, the ordering of the drag indicator and window controls is reversed 13 | * to be more native. We re-order all items including their separators so that 14 | * the markup and separator hiding and showing logic in the shared CSS file 15 | * doesn't need to be macOS-specific. 16 | */ 17 | #window-controls { 18 | order: 1; 19 | } 20 | 21 | #display-share + .separator { 22 | order: 2; 23 | } 24 | 25 | #display-share { 26 | order: 3; 27 | } 28 | 29 | #device-share + .separator { 30 | order: 4; 31 | } 32 | 33 | #device-share { 34 | order: 5; 35 | } 36 | 37 | #drag-indicator { 38 | order: 6; 39 | } 40 | 41 | /** 42 | * The minimize button on macOS should be circular, and the icon should be 43 | * centered. The asset we have for the minimize icon puts it along the bottom, 44 | * so we manually offset it here. 45 | */ 46 | #minimize { 47 | background-position: center -5px; 48 | padding: 8px; 49 | border: 1px solid transparent; 50 | border-radius: 1000px; 51 | } 52 | -------------------------------------------------------------------------------- /src/changed/browser/themes/shared/webRTC-indicator.css: -------------------------------------------------------------------------------- 1 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 | 6 | @namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 7 | @namespace html url("http://www.w3.org/1999/xhtml"); 8 | 9 | :root { 10 | appearance: none; 11 | background: transparent; 12 | border: 0; 13 | border-radius: 5px; 14 | --indicator-height: 32px; 15 | --indicator-background-color: rgb(249,249,250); 16 | --indicator-color: rgb(12,12,13); 17 | --indicator-border-color: hsla(0,0%,0%,.32); 18 | --indicator-icon-fill-opacity: 0.8; 19 | --indicator-item-separator: 1px solid hsla(210,4%,10%,.14); 20 | --indicator-stop-button-background-color: rgb(0,96,223); 21 | --indicator-stop-button-hover-background-color: rgb(0,62,170); 22 | --indicator-stop-button-color: rgb(255,255,255); 23 | --minimize-button-background-color: hsla(240,5%,5%,.1); 24 | --minimize-button-hover-background-color: hsla(240,5%,5%,.15); 25 | --minimize-button-active-background-color: hsla(240,5%,5%,.2); 26 | --control-icon-unchecked-hover-background-color: hsla(0,0%,70%,.4); 27 | --control-icon-unchecked-active-background-color: hsla(0,0%,70%,.6); 28 | --control-icon-checked-background-color: hsla(10,100%,50%,.16); 29 | --control-icon-checked-icon-fill: rgb(215,0,34); 30 | --control-icon-checked-hover-background-color: hsla(10,100%,50%,.24); 31 | --control-icon-checked-active-background-color: hsla(10,100%,50%,.32); 32 | max-height: var(--indicator-height); 33 | } 34 | 35 | @media (prefers-color-scheme: dark) { 36 | :root { 37 | --indicator-background-color: hsl(240, 1%, 20%); 38 | --indicator-color: rgb(249, 249, 250); 39 | --indicator-border-color: hsl(240, 1%, 40%); 40 | --indicator-item-separator: 1px solid rgb(249, 249, 250); 41 | --minimize-button-background-color: rgba(249,249,250,0.1); 42 | --minimize-button-hover-background-color: rgba(249,249,250,0.15); 43 | --minimize-button-active-background-color: rgba(249,249,250,0.2); 44 | --control-icon-unchecked-hover-background-color: rgba(249,249,250,0.15); 45 | --control-icon-unchecked-active-background-color: rgba(249,249,250,0.2); 46 | --control-icon-checked-background-color: hsla(343,100%,58%,.16); 47 | --control-icon-checked-icon-fill: rgb(255,40,102); 48 | --control-icon-checked-hover-background-color: hsla(343,100%,58%,.24); 49 | --control-icon-checked-active-background-color: hsla(343,100%,58%,.32); 50 | } 51 | } 52 | 53 | body { 54 | display: inline-flex; 55 | background-color: var(--indicator-background-color); 56 | color: var(--indicator-color); 57 | margin: 0; 58 | user-select: none; 59 | -moz-window-dragging: drag; 60 | /** 61 | * On macOS, for windows with small enough dimensions, we seem to get 62 | * vertical scrollbars on the body, even when the contents initially 63 | * fit the window. We sidestep this by making sure we never display 64 | * scrollbars. 65 | */ 66 | overflow: hidden; 67 | cursor: move; 68 | border: 1px solid; 69 | border-color: var(--indicator-border-color); 70 | /* max-height = indicator height minus top and bottom border */ 71 | max-height: calc(var(--indicator-height) - 2px); 72 | } 73 | 74 | button, 75 | input[type="checkbox"] { 76 | appearance: none; 77 | border-style: none; 78 | margin: 0; 79 | -moz-context-properties: fill, fill-opacity; 80 | fill: currentColor; 81 | fill-opacity: var(--indicator-icon-fill-opacity); 82 | background-repeat: no-repeat; 83 | -moz-window-dragging: no-drag; 84 | color: inherit; 85 | } 86 | 87 | .row-item { 88 | display: flex; 89 | align-items: center; 90 | min-width: 30px; 91 | margin-block: 5px; 92 | margin-inline: 0 5px; 93 | box-sizing: border-box; 94 | padding: 0 5px; 95 | } 96 | 97 | .separator { 98 | border-inline-end: var(--indicator-item-separator); 99 | min-width: 1px; 100 | padding: 0; 101 | } 102 | 103 | /** 104 | * For display sharing, if we happen to be sharing both 105 | * a window and a screen, we want to show the UI for sharing 106 | * the screen, since that's the more privacy-sensitive one. 107 | */ 108 | :root[sharingwindow]:not([sharingscreen]) > body > #display-share > #screen-share-info, 109 | :root[sharingwindow]:not([sharingbrowserwindow]) > body > #display-share > #browser-window-share-info, 110 | :root[sharingwindow][sharingbrowserwindow] > body > #display-share > #window-share-info, 111 | :root[sharingscreen] > body > #display-share > #window-share-info, 112 | :root[sharingscreen] > body > #display-share > #browser-window-share-info, 113 | 114 | /** 115 | * If we're not sharing either the screen or the window, we can 116 | * hide the entire display sharing section. 117 | */ 118 | :root:not([sharingscreen],[sharingwindow]) > body > #display-share, 119 | :root:not([sharingscreen],[sharingwindow]) > body > #display-share + .separator, 120 | :root:not([sharingvideo]) > body > #device-share > #camera-mute-toggle, 121 | :root:not([sharingaudio]) > body > #device-share > #microphone-mute-toggle, 122 | :root:not([sharingvideo],[sharingaudio]) > body > #device-share, 123 | :root:not([sharingvideo],[sharingaudio]) > body > #device-share + .separator { 124 | display:none; 125 | } 126 | 127 | xul|menu { 128 | overflow: hidden; 129 | min-height: 0 !important; 130 | height: 0 !important; 131 | width: 0 !important; 132 | appearance: none !important; 133 | padding: 0 !important; 134 | } 135 | 136 | .control-icon { 137 | background-position: center; 138 | background-size: 16px; 139 | background-color: transparent; 140 | padding: 10px 16px; 141 | border-radius: 5px; 142 | } 143 | 144 | .control-icon + .control-icon { 145 | margin-inline-start: 6px; 146 | } 147 | 148 | .control-icon:hover { 149 | background-color: var(--control-icon-unchecked-hover-background-color); 150 | } 151 | 152 | .control-icon:active { 153 | background-color: var(--control-icon-unchecked-active-background-color); 154 | } 155 | 156 | .control-icon:checked { 157 | background-color: var(--control-icon-checked-background-color); 158 | -moz-context-properties: fill; 159 | fill: var(--control-icon-checked-icon-fill); 160 | } 161 | 162 | .control-icon:checked:hover { 163 | background-color: var(--control-icon-checked-hover-background-color); 164 | } 165 | 166 | .control-icon:checked:active { 167 | background-color: var(--control-icon-checked-active-background-color); 168 | } 169 | 170 | #display-share-icon { 171 | background-image: url("chrome://browser/skin/notification-icons/screen.svg"); 172 | width: 16px; 173 | height: 16px; 174 | margin-inline: 5px 10px; 175 | -moz-context-properties: fill, fill-opacity; 176 | fill: currentColor; 177 | fill-opacity: var(--indicator-icon-fill-opacity); 178 | } 179 | 180 | #camera-mute-toggle { 181 | background-image: url("chrome://browser/skin/notification-icons/camera.svg"); 182 | } 183 | 184 | #camera-mute-toggle:checked { 185 | background-image: url("chrome://browser/skin/notification-icons/camera-blocked.svg"); 186 | } 187 | 188 | #microphone-mute-toggle { 189 | background-image: url("chrome://browser/skin/notification-icons/microphone.svg"); 190 | } 191 | 192 | #microphone-mute-toggle:checked { 193 | background-image: url("chrome://browser/skin/notification-icons/microphone-blocked.svg"); 194 | } 195 | 196 | .stop-button { 197 | background-color: var(--indicator-stop-button-background-color); 198 | color: var(--indicator-stop-button-color); 199 | border-radius: 5px; 200 | padding: 3px 5px; 201 | margin-inline-start: 15px; 202 | } 203 | 204 | .stop-button:hover { 205 | background-color: var(--indicator-stop-button-hover-background-color); 206 | } 207 | 208 | #window-controls { 209 | display: flex; 210 | flex-direction: column; 211 | align-items: center; 212 | } 213 | 214 | #minimize { 215 | padding: 10px; 216 | min-width: unset; 217 | background-image: url("chrome://browser/skin/notification-icons/minimize.svg"); 218 | background-color: var(--minimize-button-background-color); 219 | } 220 | 221 | #minimize:hover { 222 | background-color: var(--minimize-button-hover-background-color); 223 | } 224 | 225 | #minimize:active { 226 | background-color: var(--minimize-button-active-background-color); 227 | } 228 | 229 | #drag-indicator { 230 | background-image: url("chrome://browser/skin/notification-icons/drag-indicator.svg"); 231 | background-repeat: no-repeat; 232 | background-position: center; 233 | width: 5px; 234 | -moz-context-properties: fill, fill-opacity; 235 | fill: currentColor; 236 | fill-opacity: 0.4; 237 | margin: 5px; 238 | } 239 | 240 | #webRTC-sharingCamera-menu, 241 | #webRTC-sharingMicrophone-menu, 242 | #webRTC-sharingScreen-menu { 243 | -moz-context-properties: fill; 244 | fill: currentColor; 245 | position: fixed !important; 246 | bottom: 0 !important; 247 | right: 0 !important; 248 | } 249 | 250 | #webRTC-sharingCamera-menu { 251 | list-style-image: url("chrome://browser/skin/notification-icons/camera.svg"); 252 | } 253 | 254 | #webRTC-sharingMicrophone-menu { 255 | list-style-image: url("chrome://browser/skin/notification-icons/microphone.svg"); 256 | } 257 | 258 | #webRTC-sharingScreen-menu { 259 | list-style-image: url("chrome://browser/skin/notification-icons/screen.svg"); 260 | } 261 | 262 | #webRTC-sharingCamera-menu > menupopup, 263 | #webRTC-sharingMicrophone-menu > menupopup, 264 | #webRTC-sharingScreen-menu > menupopup { 265 | list-style-image: none; /* don't inherit into menu items */ 266 | } 267 | 268 | @media (-moz-platform: macos) { 269 | /** 270 | * On macOS, the ordering of the drag indicator and window controls is reversed 271 | * to be more native. We re-order all items including their separators so that 272 | * the markup and separator hiding and showing logic in the shared CSS file 273 | * doesn't need to be macOS-specific. 274 | */ 275 | #window-controls { 276 | order: 1; 277 | } 278 | 279 | #display-share + .separator { 280 | order: 2; 281 | } 282 | 283 | #display-share { 284 | order: 3; 285 | } 286 | 287 | #device-share + .separator { 288 | order: 4; 289 | } 290 | 291 | #device-share { 292 | order: 5; 293 | } 294 | 295 | #drag-indicator { 296 | order: 6; 297 | } 298 | 299 | /** 300 | * The minimize button on macOS should be circular, and the icon should be 301 | * centered. The asset we have for the minimize icon puts it along the bottom, 302 | * so we manually offset it here. 303 | */ 304 | #minimize { 305 | background-position: center -5px; 306 | padding: 8px; 307 | border: 1px solid transparent; 308 | border-radius: 1000px; 309 | } 310 | } 311 | 312 | @media (-moz-platform: windows) { 313 | @media (-moz-windows-default-theme: 0) { 314 | :root { 315 | --indicator-background-color: -moz-Dialog; 316 | --indicator-color: -moz-DialogText; 317 | --indicator-border-color: InactiveBorder; 318 | --indicator-item-separator: 1px solid ThreeDShadow; 319 | --indicator-stop-button-background-color: hsla(0,0%,70%,.2); 320 | --indicator-stop-button-hover-background-color: hsla(0,0%,70%,.4); 321 | --indicator-stop-button-color: inherit; 322 | --minimize-button-background-color: hsla(0,0%,70%,.2); 323 | --minimize-button-hover-background-color: hsla(0,0%,70%,.4); 324 | --minimize-button-active-background-color: hsla(0,0%,70%,.6); 325 | --control-icon-unchecked-hover-background-color: hsla(0,0%,70%,.2); 326 | --control-icon-unchecked-active-background-color: hsla(0,0%,70%,.6); 327 | --control-icon-checked-background-color: SelectedItem; 328 | --control-icon-checked-icon-fill: SelectedItemText; 329 | --control-icon-checked-hover-background-color: hsla(0,0%,70%,.2); 330 | --control-icon-checked-active-background-color: hsla(0,0%,70%,.6); 331 | } 332 | 333 | #minimize, 334 | .stop-button { 335 | border: 1px outset ThreeDLightShadow; 336 | } 337 | } 338 | 339 | #webRTC-sharingCamera-menu { 340 | list-style-image: url("chrome://browser/skin/notification-icons/camera.png"); 341 | } 342 | 343 | #webRTC-sharingMicrophone-menu { 344 | list-style-image: url("chrome://browser/skin/notification-icons/microphone.png"); 345 | } 346 | 347 | #webRTC-sharingScreen-menu { 348 | list-style-image: url("chrome://browser/skin/notification-icons/screen.png"); 349 | } 350 | } -------------------------------------------------------------------------------- /src/changed/browser/themes/windows/browser.css: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | @import url("chrome://browser/skin/browser-shared.css"); 6 | @import url("chrome://browser/skin/contextmenu.css"); 7 | @import url("chrome://browser/skin/browser-custom-colors.css"); 8 | 9 | @namespace html url("http://www.w3.org/1999/xhtml"); 10 | 11 | /* neutron stuff. remove unwanted ui like tabs and url bar and webrtc indicator */ 12 | #TabsToolbar { visibility: collapse !important; } 13 | #navigator-toolbox .browser-toolbar { height: 0px !important; min-height: 0px !important; visibility: visible; border-bottom: 0px !important;} 14 | 15 | :root { 16 | --toolbar-non-lwt-bgcolor: -moz-dialog; 17 | --toolbar-non-lwt-textcolor: -moz-dialogtext; 18 | --toolbar-non-lwt-bgimage: linear-gradient(rgba(255,255,255,.15), rgba(255,255,255,.15)); 19 | 20 | --toolbarbutton-vertical-text-padding: calc(var(--toolbarbutton-inner-padding) - 1px); 21 | --toolbarbutton-border-radius: 4px; 22 | 23 | --panel-separator-color: ThreeDLightShadow; 24 | 25 | --chrome-content-separator-color: ThreeDShadow; 26 | } 27 | 28 | @media (-moz-windows-default-theme) { 29 | :root { 30 | --toolbar-non-lwt-bgimage: none; 31 | 32 | --panel-separator-color: hsla(210,4%,10%,.14); 33 | } 34 | } 35 | 36 | :root:-moz-lwtheme { 37 | --chrome-content-separator-color: rgba(0,0,0,.3); 38 | 39 | --panel-separator-color: hsla(210,4%,10%,.14); 40 | } 41 | 42 | :root[lwt-popup-brighttext] { 43 | --panel-separator-color: rgba(249,249,250,.1); 44 | } 45 | 46 | #menubar-items { 47 | -moz-box-orient: vertical; /* for flex hack */ 48 | } 49 | 50 | #main-menubar > menu { 51 | appearance: none; 52 | color: inherit; 53 | } 54 | 55 | #main-menubar > menu[_moz-menuactive="true"] { 56 | background-color: -moz-menuhover; 57 | color: -moz-menuhovertext; 58 | } 59 | 60 | /* Use a different color only on Windows 8 and higher in inactive windows. 61 | * On Win 7, the menubar fog disappears for inactive windows, and renders gray 62 | * illegible. 63 | */ 64 | @media (-moz-windows-default-theme) { 65 | @media not (-moz-platform: windows-win7) { 66 | #toolbar-menubar:not(:-moz-lwtheme):-moz-window-inactive { 67 | color: ThreeDShadow; 68 | } 69 | } 70 | } 71 | 72 | @media not (-moz-platform: windows-win7) { 73 | @media not (-moz-platform: windows-win8) { 74 | /* On Windows 10, when temporarily showing the menu bar, make it at least as 75 | * tall as the tab bar such that the window controls don't appear to move up. */ 76 | :root[tabsintitlebar] #toolbar-menubar[autohide="true"] { 77 | height: calc(var(--tab-min-height) - var(--tabs-navbar-shadow-size)); 78 | } 79 | :root[tabsintitlebar][sizemode="normal"] #toolbar-menubar[autohide="true"] { 80 | height: calc(var(--tab-min-height) - var(--tabs-navbar-shadow-size)); 81 | } 82 | } 83 | } 84 | 85 | /* Add 4px extra margin on top of the tabs toolbar on Windows 7. */ 86 | @media (-moz-platform: windows-win7) { 87 | :root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .toolbar-items, 88 | :root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .toolbar-items { 89 | padding-top: 4px; 90 | } 91 | } 92 | 93 | #navigator-toolbox, 94 | .browser-toolbar { 95 | appearance: none; 96 | } 97 | 98 | .browser-toolbar:not(.titlebar-color) { 99 | background-color: var(--toolbar-bgcolor); 100 | background-image: var(--toolbar-bgimage); 101 | background-clip: padding-box; 102 | color: var(--toolbar-color); 103 | } 104 | 105 | /* Add a fog for background tabs to be visible on Windows 7 glass window background */ 106 | @media (-moz-platform: windows-win7) { 107 | @media (-moz-windows-default-theme) { 108 | #TabsToolbar:not(:-moz-lwtheme) { 109 | background-image: radial-gradient(ellipse at bottom, rgba(255,255,255,0.8), rgba(255,255,255,0.5) 80%, transparent); 110 | } 111 | } 112 | } 113 | 114 | @media (-moz-windows-compositor: 0), 115 | (-moz-windows-default-theme: 0), 116 | (-moz-platform: windows-win8) { 117 | /* Please keep the menu text colors in this media block in sync with 118 | * light-dark-overrides.css, minus the :not(:-moz-lwtheme) condition - see Bug 1165718. 119 | */ 120 | :root[tabsintitlebar]:not(:-moz-lwtheme) { 121 | color: CaptionText; 122 | } 123 | 124 | :root[tabsintitlebar]:not(:-moz-lwtheme):-moz-window-inactive { 125 | color: InactiveCaptionText; 126 | } 127 | } 128 | 129 | @media (-moz-windows-classic) { 130 | /** 131 | * In the classic themes, the titlebar has a horizontal gradient, which is 132 | * problematic for reading the text of background tabs when they're in the 133 | * titlebar. We side-step this issue by layering our own background underneath 134 | * the tabs. 135 | */ 136 | :root[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar:not(:-moz-lwtheme) { 137 | background-image: linear-gradient(transparent, ActiveCaption); 138 | background-size: auto 200%; 139 | } 140 | 141 | :root[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar:not(:-moz-lwtheme):-moz-window-inactive { 142 | background-image: linear-gradient(transparent, InactiveCaption); 143 | } 144 | 145 | /* Add a window top border for webextension themes */ 146 | :root[tabsintitlebar][sizemode="normal"] #navigator-toolbox:-moz-lwtheme { 147 | background-image: linear-gradient(to bottom, 148 | ThreeDLightShadow 0, ThreeDLightShadow 1px, 149 | ThreeDHighlight 1px, ThreeDHighlight 2px, 150 | ActiveBorder 2px, ActiveBorder 4px, transparent 4px); 151 | } 152 | 153 | :root[tabsintitlebar] :is(#TabsToolbar, #toolbar-menubar) toolbarbutton:not(:-moz-lwtheme) { 154 | color: inherit; 155 | } 156 | } 157 | 158 | #nav-bar:not([tabs-hidden="true"]) { 159 | /* This is needed for some toolbar button animations. Gross :( */ 160 | position: relative; 161 | } 162 | 163 | @media (-moz-windows-default-theme: 0) { 164 | #nav-bar:not(:-moz-lwtheme) { 165 | box-shadow: 0 calc(-1 * var(--tabs-navbar-shadow-size)) 0 ThreeDShadow; 166 | } 167 | } 168 | #nav-bar:-moz-lwtheme { 169 | box-shadow: 0 calc(-1 * var(--tabs-navbar-shadow-size)) 0 var(--lwt-tabs-border-color, rgba(0,0,0,.3)); 170 | } 171 | @media (-moz-windows-compositor: 0) { 172 | #nav-bar[tabs-hidden="true"] { 173 | box-shadow: none; 174 | } 175 | } 176 | 177 | /* Hide navbar for Datcord*/ 178 | #nav-bar { 179 | visibility: collapse; 180 | } 181 | 182 | #print-preview-toolbar:not(:-moz-lwtheme) { 183 | appearance: auto; 184 | -moz-default-appearance: toolbox; 185 | } 186 | 187 | #browser-bottombox:not(:-moz-lwtheme) { 188 | background-color: -moz-dialog; 189 | } 190 | 191 | /* Titlebar */ 192 | 193 | :root[tabsintitlebar][sizemode="normal"] #titlebar { 194 | appearance: auto; 195 | -moz-default-appearance: -moz-window-titlebar; 196 | } 197 | 198 | :root[tabsintitlebar][sizemode="maximized"] #titlebar { 199 | appearance: auto; 200 | -moz-default-appearance: -moz-window-titlebar-maximized; 201 | } 202 | 203 | @media (-moz-windows-compositor: 0) { 204 | /** 205 | * Anytime we're not using the compositor on Windows, the -moz-window-titlebar 206 | * and -moz-window-titlebar-maximized values for -moz-appearance override 207 | * backgrounds supplied by lwthemes. We make the #titlebar itself hidden, but 208 | * it's children visible in order to hide the background but keep the margin and 209 | * padding that comes from those -moz-window-titlebar rules. 210 | */ 211 | :root:not([inDOMFullscreen]) #titlebar:-moz-lwtheme { 212 | visibility: hidden; 213 | } 214 | :root:not([inDOMFullscreen], [chromehidden~="menubar"]) #toolbar-menubar:-moz-lwtheme, 215 | :root:not([inDOMFullscreen], [chromehidden~="toolbar"]) #TabsToolbar:-moz-lwtheme { 216 | visibility: visible; 217 | } 218 | } 219 | 220 | @media (-moz-windows-classic) { 221 | :root[tabsintitlebar][sizemode="normal"] #toolbar-menubar { 222 | margin-top: 4px; 223 | } 224 | } 225 | 226 | .titlebar-buttonbox { 227 | /* For all Windows configurations except for Windows Aero and Windows Aero Basic, 228 | * the default -moz-default-appearance of -moz-window-button-box and 229 | * -moz-window-button-box-maximized adds unwanted margins to the button box. We 230 | * special case Windows Aero and Windows Aero Basic in browser-aero.css. 231 | */ 232 | appearance: none; 233 | /* The button box must appear on top of the navigator-toolbox in order for 234 | * click and hover mouse events to work properly for the button in the restored 235 | * window state. Otherwise, elements in the navigator-toolbox, like the menubar, 236 | * can swallow those events. It will also place the buttons above the fog on 237 | * Windows 7 with Aero Glass. 238 | */ 239 | z-index: 1; 240 | } 241 | 242 | .titlebar-buttonbox-container { 243 | -moz-box-align: stretch; 244 | } 245 | 246 | @media (-moz-platform: windows-win7), 247 | (-moz-platform: windows-win8) { 248 | /* Preserve window control buttons position at the top of the button box. */ 249 | .titlebar-buttonbox-container { 250 | -moz-box-align: start; 251 | } 252 | } 253 | 254 | /* Window control buttons */ 255 | 256 | .titlebar-min { 257 | appearance: auto; 258 | -moz-default-appearance: -moz-window-button-minimize; 259 | } 260 | 261 | .titlebar-max { 262 | appearance: auto; 263 | -moz-default-appearance: -moz-window-button-maximize; 264 | } 265 | 266 | .titlebar-restore { 267 | appearance: auto; 268 | -moz-default-appearance: -moz-window-button-restore; 269 | } 270 | 271 | .titlebar-close { 272 | appearance: auto; 273 | -moz-default-appearance: -moz-window-button-close; 274 | } 275 | 276 | @media (-moz-windows-classic: 0) { 277 | .titlebar-min { 278 | margin-inline-end: 2px; 279 | } 280 | } 281 | 282 | :root[tabletmode] .titlebar-min, 283 | :root[tabletmode] .titlebar-restore, 284 | :root[tabletmode] .titlebar-max { 285 | display: none; 286 | } 287 | 288 | /* Bookmark menus */ 289 | 290 | menu.bookmark-item, 291 | menuitem.bookmark-item { 292 | min-width: 0; 293 | max-width: 32em; 294 | } 295 | 296 | .bookmark-item:not(.subviewbutton) > .menu-iconic-left { 297 | margin-block: 0; 298 | } 299 | 300 | .bookmark-item > .menu-iconic-left > .menu-iconic-icon { 301 | padding-inline-start: 0; 302 | } 303 | 304 | .bookmark-item[cutting] > .toolbarbutton-icon, 305 | .bookmark-item[cutting] > .menu-iconic-left > .menu-iconic-icon { 306 | opacity: 0.5; 307 | } 308 | 309 | .bookmark-item[cutting] > .toolbarbutton-text, 310 | .bookmark-item[cutting] > .menu-iconic-left > .menu-iconic-text { 311 | opacity: 0.7; 312 | } 313 | 314 | 315 | /* Address bar */ 316 | 317 | @media not (prefers-contrast) { 318 | :root:not(:-moz-lwtheme) #urlbar { 319 | --urlbar-box-bgcolor: white; 320 | } 321 | :root[lwt-default-theme-in-dark-mode] #urlbar { 322 | --urlbar-box-bgcolor: var(--toolbar-field-focus-background-color); 323 | } 324 | } 325 | 326 | #urlbar, 327 | #searchbar { 328 | font-size: 1.15em; 329 | } 330 | 331 | @supports -moz-bool-pref("browser.urlbar.experimental.expandTextOnFocus") { 332 | #urlbar[breakout-extend] { 333 | font-size: 1.25em; 334 | } 335 | } 336 | 337 | @media (-moz-windows-default-theme: 0) { 338 | /* Windows HCM conventions use these colors for chiclets. We can't use them on 339 | other platforms because AccentColor can be shown atop SelectedItem, 340 | which has zero contrast. */ 341 | :root { 342 | --urlbar-box-hover-bgcolor: SelectedItem; 343 | --urlbar-box-active-bgcolor: SelectedItem; 344 | --urlbar-box-hover-text-color: SelectedItemText; 345 | } 346 | 347 | #urlbar:not(:-moz-lwtheme, [focused="true"]) > #urlbar-background, 348 | #searchbar:not(:-moz-lwtheme, :focus-within) { 349 | border-color: ThreeDShadow; 350 | } 351 | } 352 | 353 | /* Address bar results view */ 354 | 355 | @media (-moz-windows-default-theme: 0) { 356 | :root:not(:-moz-lwtheme) { 357 | --urlbar-popup-action-color: -moz-nativehyperlinktext; 358 | } 359 | } 360 | 361 | /* Autocomplete */ 362 | 363 | #PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] { 364 | border-top: 1px solid ThreeDShadow; 365 | } 366 | 367 | /* Content area */ 368 | 369 | #browser { 370 | --sidebar-border-color: ThreeDLightShadow; 371 | } 372 | 373 | /* Tabstrip */ 374 | 375 | #TabsToolbar { 376 | min-height: 0; 377 | padding: 0; 378 | /* Hide tabstoolbar for Datcord */ 379 | visibility: collapse; 380 | } 381 | 382 | @media (-moz-windows-default-theme: 0) { 383 | /* For high contrast themes. */ 384 | #tabbrowser-tabpanels, 385 | :root[privatebrowsingmode=temporary] #tabbrowser-tabpanels { 386 | background-color: -moz-default-background-color; 387 | } 388 | } 389 | 390 | /* All tabs menupopup */ 391 | 392 | .alltabs-item[selected="true"] { 393 | font-weight: bold; 394 | } 395 | 396 | toolbarbutton.bookmark-item[dragover="true"][open="true"] { 397 | appearance: none; 398 | background: SelectedItem !important; 399 | color: SelectedItemText !important; 400 | fill: SelectedItemText; 401 | } 402 | 403 | /* Bookmarks roots menu-items */ 404 | 405 | #bookmarksToolbarFolderMenu, 406 | #BMB_bookmarksToolbar, 407 | #panelMenu_bookmarksToolbar { 408 | list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.svg"); 409 | -moz-image-region: auto; 410 | } 411 | 412 | #PlacesToolbar menu menupopup { 413 | margin-top: -13px; 414 | } 415 | 416 | /* Status panel */ 417 | 418 | #statuspanel-label { 419 | margin: 0; 420 | padding: 2px 4px; 421 | background-color: -moz-dialog; 422 | border: 1px none ThreeDLightShadow; 423 | border-top-style: solid; 424 | color: -moz-dialogText; 425 | text-shadow: none; 426 | } 427 | 428 | @media (-moz-windows-default-theme) { 429 | #statuspanel-label { 430 | background-color: #f9f9fa; 431 | color: #444; 432 | } 433 | } 434 | 435 | @media (-moz-content-prefers-color-scheme: dark) { 436 | #statuspanel-label { 437 | background-color: hsl(240, 1%, 20%); 438 | border-color: hsl(240, 1%, 40%); 439 | color: rgb(249, 249, 250); 440 | } 441 | } 442 | 443 | #statuspanel:not([mirror]) > #statuspanel-label:-moz-locale-dir(ltr), 444 | #statuspanel[mirror] > #statuspanel-label:-moz-locale-dir(rtl) { 445 | border-right-style: solid; 446 | /* disabled for triggering grayscale AA (bug 659213) 447 | border-top-right-radius: .3em; 448 | */ 449 | margin-right: 1em; 450 | } 451 | 452 | #statuspanel:not([mirror]) > #statuspanel-label:-moz-locale-dir(rtl), 453 | #statuspanel[mirror] > #statuspanel-label:-moz-locale-dir(ltr) { 454 | border-left-style: solid; 455 | /* disabled for triggering grayscale AA (bug 659213) 456 | border-top-left-radius: .3em; 457 | */ 458 | margin-left: 1em; 459 | } 460 | 461 | /* Prevent window controls from overlapping the nav bar's shadow on the tab 462 | * bar. */ 463 | #TabsToolbar > .titlebar-buttonbox-container { 464 | margin-bottom: var(--tabs-navbar-shadow-size); 465 | } 466 | 467 | .private-browsing-indicator { 468 | margin-inline: 12px; 469 | } 470 | 471 | #UITourTooltipButtons { 472 | /** 473 | * Override the --arrowpanel-padding so the background extends 474 | * to the sides and bottom of the panel. 475 | */ 476 | margin-inline: -10px; 477 | margin-bottom: -10px; 478 | } 479 | 480 | /* Make menu items larger when opened through touch. */ 481 | #widget-overflow[touchmode] .toolbarbutton-1, 482 | panel[touchmode] .PanelUI-subView .subviewbutton, 483 | menupopup[touchmode] menu, 484 | menupopup[touchmode] menuitem { 485 | --arrowpanel-menuitem-padding-block: 12px; 486 | padding-block: var(--arrowpanel-menuitem-padding-block); 487 | } 488 | 489 | #contentAreaContextMenu[touchmode] > #context-navigation > menuitem { 490 | padding-block: 7px; 491 | } 492 | 493 | #context-navigation { 494 | background-color: menu; 495 | padding-bottom: 4px; 496 | } 497 | 498 | #context-sep-navigation { 499 | margin-inline-start: -28px; 500 | margin-top: -4px; 501 | } 502 | 503 | @media (-moz-windows-non-native-menus) { 504 | /* :not([hidden]) to avoid the display: flex unhiding the item. */ 505 | #context-navigation:not([hidden]) { 506 | /* The Windows 10 version of the navigation area needs the scrollbox's 507 | background color, not the builtin "menu" color. */ 508 | background-color: inherit; 509 | padding: 0 0 4px; 510 | /* Use modern flex box so we can use percentage widths to redistribute 511 | * spacing manually. */ 512 | display: flex; 513 | flex-direction: row; 514 | /* We want the first and last icons to align with the text items which 515 | * have 1em inline padding, and for icons to be centered within their 516 | * hover state, so each icon of 16px needs 1em padding on both sides: 517 | */ 518 | --menuitem-min-width: calc(2em + 16px); 519 | /* The total width of the container should then be at least 4 times that: */ 520 | min-width: calc(4 * var(--menuitem-min-width)); 521 | } 522 | 523 | #context-navigation > .menuitem-iconic { 524 | flex: 1 0 auto; 525 | } 526 | 527 | #context-navigation > .menuitem-iconic[_moz-menuactive="true"] { 528 | /* We only show hover state on the icons. This ensures there is no 529 | * dead space between icons, but the visible hover state is only 530 | * around the icons, and all the icons' hover states match each other. 531 | */ 532 | background-color: transparent; 533 | } 534 | 535 | #context-navigation > .menuitem-iconic > .menu-iconic-left { 536 | margin: 0; 537 | padding: 0; 538 | } 539 | 540 | /* override styles from shared/contextmenu.inc.css */ 541 | #context-navigation > .menuitem-iconic > .menu-iconic-left > .menu-iconic-icon { 542 | width: var(--menuitem-min-width); 543 | height: 32px; 544 | padding: 8px 1em; 545 | margin: 0; 546 | } 547 | #context-navigation > .menuitem-iconic[_moz-menuactive="true"] > .menu-iconic-left > .menu-iconic-icon { 548 | background-color: -moz-menuhover; 549 | } 550 | 551 | #context-navigation > .menuitem-iconic[_moz-menuactive="true"][disabled="true"] > .menu-iconic-left > .menu-iconic-icon { 552 | background-color: -moz-menuhoverdisabled; 553 | } 554 | 555 | /* If the menu is wider than the icons strictly need, the elements 556 | * will stretch to pick up the extra space. In that case, the outer icons 557 | * should align to the start/end of their containing : */ 558 | #context-navigation > .menuitem-iconic:first-child { 559 | -moz-box-pack: start; 560 | } 561 | 562 | #context-navigation > .menuitem-iconic:last-child { 563 | -moz-box-pack: end; 564 | } 565 | 566 | #context-navigation > .menuitem-iconic:last-child, 567 | #context-navigation > .menuitem-iconic:first-child { 568 | flex-grow: 0; 569 | /* The first and last items start off as 16px + 2em, like the other ones. 570 | * 100% is the width of the parent, which will be at least 4 * the width of 571 | * an individual item (16px + 2em) 572 | * So 100% - 4 item widths gets us the remaining available space if 573 | * #context-navigation is wider than that. 574 | * Then divide by 6 to get the 1/6 of that extra space, and add this space 575 | * to the width of the first/last items. 576 | * This ensures that the 3 visual gaps between the 4 icons are all the same 577 | * size, with each 1/3 of the available space evenly distributed between 578 | * the 2 items on either side of the gap. 579 | */ 580 | width: calc(var(--menuitem-min-width) + calc(100% - 4 * var(--menuitem-min-width)) / 6); 581 | } 582 | 583 | 584 | /* Other menu separators don't extend all the way to the menu edges, but the 585 | one below the navigation buttons in the content context menu should. */ 586 | #context-sep-navigation { 587 | margin-top: 0; 588 | margin-inline: 0; 589 | } 590 | } 591 | 592 | .cui-widget-panelview[id^=PanelUI-webext-] { 593 | border-radius: var(--arrowpanel-border-radius); 594 | } 595 | 596 | .webextension-popup-browser, 597 | .webextension-popup-stack { 598 | border-radius: inherit; 599 | } 600 | 601 | #historySwipeAnimationPreviousArrow { 602 | background: url("chrome://browser/skin/history-swipe-arrow.svg") 603 | center left / 192px 192px no-repeat transparent; 604 | will-change: transform; 605 | -moz-context-properties: fill; 606 | } 607 | #historySwipeAnimationPreviousArrow:-moz-locale-dir(rtl) { 608 | transform: scaleX(-1); 609 | } 610 | #historySwipeAnimationNextArrow { 611 | background: url("chrome://browser/skin/history-swipe-arrow.svg") 612 | center left / 192px 192px no-repeat transparent; 613 | will-change: transform; 614 | -moz-context-properties: fill; 615 | } 616 | #historySwipeAnimationNextArrow:-moz-locale-dir(ltr) { 617 | transform: scaleX(-1); 618 | } 619 | -------------------------------------------------------------------------------- /src/changed/browser/themes/windows/webRTC-indicator.css: -------------------------------------------------------------------------------- 1 | %if 0 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 | %endif 6 | 7 | @namespace html url("http://www.w3.org/1999/xhtml"); 8 | 9 | %include ../shared/webRTC-indicator.inc.css 10 | -------------------------------------------------------------------------------- /src/distribution/policies-flatpak.json: -------------------------------------------------------------------------------- 1 | { 2 | "policies": { 3 | "DisplayMenuBar" : "never", 4 | "Extensions": { 5 | "Install": NEUTRON_EXTENSION_URLS 6 | }, 7 | "Handlers": { 8 | "schemes": { 9 | "open": { 10 | "action": "useHelperApp", 11 | "ask": false, 12 | "handlers": [{ 13 | "name": "default-browser", 14 | "path": "/tmp/open-in-default-browser" 15 | }] 16 | } 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/distribution/policies-linux-appimage.json: -------------------------------------------------------------------------------- 1 | { 2 | "policies": { 3 | "DisplayMenuBar" : "never", 4 | "Extensions": { 5 | "Install": NEUTRON_EXTENSION_URLS 6 | }, 7 | "Handlers": { 8 | "schemes": { 9 | "open": { 10 | "action": "useHelperApp", 11 | "ask": false, 12 | "handlers": [{ 13 | "name": "default-browser", 14 | "path": "/tmp/open-in-default-browser" 15 | }] 16 | } 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/distribution/policies-linux.json: -------------------------------------------------------------------------------- 1 | { 2 | "policies": { 3 | "DisplayMenuBar" : "never", 4 | "Extensions": { 5 | "Install": NEUTRON_EXTENSION_URLS 6 | }, 7 | "Handlers": { 8 | "schemes": { 9 | "open": { 10 | "action": "useHelperApp", 11 | "ask": false, 12 | "handlers": [{ 13 | "name": "default-browser", 14 | "path": "/tmp/open-in-default-browser" 15 | }] 16 | } 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/distribution/policies-windows.json: -------------------------------------------------------------------------------- 1 | { 2 | "policies": { 3 | "DisplayMenuBar" : "never", 4 | "Extensions": { 5 | "Install": NEUTRON_EXTENSION_URLS 6 | }, 7 | "Handlers": { 8 | "schemes": { 9 | "open": { 10 | "action": "useHelperApp", 11 | "ask": false, 12 | "handlers": [{ 13 | "name": "default-browser", 14 | "path": "C:\\Program Files\\NEUTRON_APP_NAME\\open-in-default-browser.bat" 15 | }] 16 | } 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/launch-app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # A few variables need to be set with -D... at configure: 2 | # APPLICATION_NAME: string 3 | # SHOULD_OPEN_IN_DEFAULT_BROWSER: true or false 4 | # SHOULD_RUN_IN_BACKGROUND: true or false 5 | # RES_PATH (only if Windows): path/to/app.res 6 | 7 | cmake_minimum_required(VERSION 3.27.4) 8 | project(launch-app) 9 | 10 | file(GLOB_RECURSE sources src/*.cpp src/*.hpp) 11 | 12 | set( BOOST_INCLUDE_LIBRARIES dll interprocess process algorithm thread ) 13 | 14 | if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 15 | add_subdirectory(extern/boost/ EXCLUDE_FROM_ALL) 16 | add_subdirectory(extern/traypp EXCLUDE_FROM_ALL) 17 | endif() 18 | 19 | add_executable(launch-app ${sources} ${Boost_INCLUDE_DIRS} ${RES_PATH}) 20 | 21 | target_compile_options(launch-app PRIVATE -std=c++17 -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -O2) 22 | 23 | target_compile_definitions(launch-app PRIVATE APPLICATION_NAME=${APPLICATION_NAME} SHOULD_OPEN_IN_DEFAULT_BROWSER=${SHOULD_OPEN_IN_DEFAULT_BROWSER} SHOULD_RUN_IN_BACKGROUND=${SHOULD_RUN_IN_BACKGROUND}) 24 | 25 | if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 26 | target_link_libraries(launch-app PRIVATE 27 | $<$:ws2_32> 28 | Boost::headers Boost::interprocess Boost::dll Boost::process Boost::algorithm 29 | tray 30 | ) 31 | else() 32 | target_link_libraries(launch-app PRIVATE 33 | ${BOOST_SYSTEM_LIB} 34 | ${BOOST_THREAD_LIB} 35 | ) 36 | target_include_directories(launch-app PRIVATE 37 | ${MY_BOOST_INCLUDE_DIRS} 38 | ) 39 | endif() 40 | -------------------------------------------------------------------------------- /src/launch-app/README.md: -------------------------------------------------------------------------------- 1 | This program launches the neutron app. It assists with putting it into the tray. -------------------------------------------------------------------------------- /src/launch-app/src/linux.cpp: -------------------------------------------------------------------------------- 1 | #if defined(__linux__) 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "platform_specific.hpp" 8 | #include "placeholders.hpp" 9 | #include "running_guard.hpp" 10 | #include "tray.hpp" 11 | 12 | #define OPEN_IN_DEFAULT_BROWSER_PATH "/tmp/open-in-default-browser" 13 | 14 | void platform_specific::move_open_in_default_browser_script(std::filesystem::path appDir){ 15 | try { 16 | std::filesystem::copy_file(appDir/"open-in-default-browser", OPEN_IN_DEFAULT_BROWSER_PATH); 17 | } catch (const std::filesystem::filesystem_error &e){ 18 | // File exists, its ok 19 | } 20 | return; 21 | } 22 | 23 | void platform_specific::clean_open_in_default_browser_script(){ 24 | std::filesystem::remove(OPEN_IN_DEFAULT_BROWSER_PATH); 25 | return; 26 | } 27 | 28 | Tray::Tray *platform_specific::setup_tray(std::filesystem::path appDir, running_guard::guard &instance_guard, bool& window_state, bool &should_exit){ 29 | Tray::Tray *tray = new Tray::Tray(APPLICATION_NAME, std::string(appDir/"browser/chrome/icons/default/default128.png")); 30 | tray->addEntry(Tray::SyncedToggle("Show Window", window_state, [&](bool){})); 31 | tray->addEntry(Tray::Button("Exit", [&]{should_exit = true;})); 32 | 33 | return tray; 34 | } 35 | 36 | #endif -------------------------------------------------------------------------------- /src/launch-app/src/mac.cpp: -------------------------------------------------------------------------------- 1 | #ifdef __APPLE__ 2 | #include 3 | 4 | #include "platform_specific.hpp" 5 | #include "placeholders.hpp" 6 | 7 | #define OPEN_IN_DEFAULT_BROWSER_PATH "/tmp/open-in-default-browser" 8 | 9 | void platform_specific::move_open_in_default_browser_script(std::filesystem::path appDir){ 10 | try { 11 | std::filesystem::copy_file(appDir/"open-in-default-browser", OPEN_IN_DEFAULT_BROWSER_PATH); 12 | } catch (const std::filesystem::filesystem_error &e){ 13 | // File exists, its ok 14 | } 15 | return; 16 | } 17 | 18 | void platform_specific::clean_open_in_default_browser_script(){ 19 | std::filesystem::remove(OPEN_IN_DEFAULT_BROWSER_PATH); 20 | return; 21 | } 22 | 23 | // Traypp doesn't support macos 24 | Tray::Tray *platform_specific::setup_tray(std::filesystem::path appDir, running_guard::guard &instance_guard, bool& window_state, bool &should_exit){ 25 | return nullptr; 26 | } 27 | #endif -------------------------------------------------------------------------------- /src/launch-app/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #ifndef __kernel_entry 19 | #define __kernel_entry 20 | #endif 21 | #include 22 | 23 | #if defined(WIN32) 24 | #include 25 | #endif 26 | 27 | #include "platform_specific.hpp" 28 | #include "running_guard.hpp" 29 | #include "placeholders.hpp" 30 | 31 | std::filesystem::path executablePath(){ 32 | return std::filesystem::path(boost::dll::program_location().string()); 33 | } 34 | 35 | void runApp(int argc, char *argv[], std::filesystem::path appDir, running_guard::guard &instance_guard, bool &window_state, Tray::Tray *tray, bool &should_exit){ 36 | std::vector args; 37 | std::vector headlessArgs; 38 | 39 | #if defined(WIN32) 40 | args.push_back("-wait-for-browser"); 41 | headlessArgs.push_back("-wait-for-browser"); 42 | #endif 43 | 44 | headlessArgs.push_back("--headless"); 45 | 46 | for (int i = 1; i < argc; i++){ 47 | args.push_back(std::string(argv[i])); 48 | headlessArgs.push_back(std::string(argv[i])); 49 | } 50 | 51 | if (SHOULD_RUN_IN_BACKGROUND){ 52 | while (true){ 53 | if (should_exit) 54 | return; 55 | 56 | boost::process::child app((appDir/APPLICATION_NAME).string(), args); 57 | window_state = true; 58 | if (tray) 59 | tray->update(); 60 | while (true){ 61 | 62 | if (should_exit){ 63 | app.terminate(); 64 | return; 65 | } 66 | 67 | if (window_state){ 68 | if (app.wait_for(std::chrono::milliseconds(100))){ 69 | window_state = false; 70 | if (tray) 71 | tray->update(); 72 | printf("App Closed!\n"); 73 | break; 74 | } 75 | } else { 76 | printf("Stopping App\n"); 77 | app.terminate(); 78 | break; 79 | } 80 | } 81 | 82 | // On close, launch headless. 83 | window_state = false; 84 | if (tray) 85 | tray->update(); 86 | 87 | boost::process::child appHeadless((appDir/APPLICATION_NAME).string(), headlessArgs); 88 | 89 | printf("Started headless\n"); 90 | 91 | bool waiter_exited = false; 92 | 93 | auto waiter = new boost::thread([&]{ 94 | instance_guard.waitForOtherProgram(); 95 | waiter_exited = true; 96 | }); 97 | 98 | while (true){ 99 | if (should_exit){ 100 | appHeadless.terminate(); 101 | return; 102 | } 103 | if (waiter_exited){ 104 | break; 105 | } 106 | if (window_state){ 107 | break; 108 | } 109 | std::this_thread::sleep_for(std::chrono::milliseconds(50)); 110 | } 111 | 112 | try { 113 | delete waiter; 114 | } catch (std::exception &e){ 115 | std::cout << e.what(); 116 | } 117 | 118 | appHeadless.terminate(); 119 | } 120 | } else { 121 | boost::process::child app((appDir/APPLICATION_NAME).string(), args); 122 | app.wait(); 123 | } 124 | 125 | return; 126 | } 127 | 128 | // Get the destructors to run 129 | [[noreturn]] void signal_handler(int signal){ 130 | exit(-1); 131 | } 132 | 133 | int main(int argc, char *argv[]) { 134 | 135 | // We need to cleanup the mutexes 136 | signal(SIGINT, signal_handler); 137 | signal(SIGABRT, signal_handler); 138 | signal(SIGFPE, signal_handler); 139 | signal(SIGILL, signal_handler); 140 | signal(SIGSEGV, signal_handler); 141 | signal(SIGTERM, signal_handler); 142 | 143 | #ifndef _WIN32 144 | std::signal(SIGKILL, signal_handler); 145 | #endif 146 | 147 | auto instance_guard = running_guard::guard(APPLICATION_NAME); 148 | 149 | if (instance_guard.otherProgramExists){ 150 | sleep(1); 151 | return 0; 152 | } 153 | 154 | std::filesystem::path appDir = executablePath().parent_path(); 155 | 156 | bool window_state = true; 157 | bool should_exit = false; 158 | 159 | // Tray 160 | Tray::Tray *tray = nullptr; 161 | std::thread *tray_runner; 162 | if (SHOULD_RUN_IN_BACKGROUND){ 163 | tray = platform_specific::setup_tray(appDir, instance_guard, window_state, should_exit); 164 | #ifndef __APPLE__ 165 | tray_runner = new std::thread([&]{tray->run();}); 166 | #endif 167 | } 168 | 169 | 170 | // Open in default browser stuff 171 | if (SHOULD_OPEN_IN_DEFAULT_BROWSER){ 172 | platform_specific::move_open_in_default_browser_script(appDir); 173 | } 174 | 175 | // Run application 176 | runApp(argc, argv, appDir, instance_guard, window_state, tray, should_exit); 177 | 178 | if (tray){ 179 | tray->exit(); 180 | } 181 | 182 | return 0; 183 | } 184 | 185 | #if defined(WIN32) 186 | int WinMain(HINSTANCE hInstance, 187 | HINSTANCE hPrevInstance, 188 | LPTSTR lpCmdLine, 189 | int cmdShow) 190 | { 191 | return main(__argc, __argv); 192 | } 193 | #endif -------------------------------------------------------------------------------- /src/launch-app/src/placeholders.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // This file fixes the placeholders that should be defined when compiling so the IDE shuts up 4 | 5 | #ifndef SHOULD_RUN_IN_BACKGROUND 6 | #define SHOULD_RUN_IN_BACKGROUND true 7 | #endif 8 | 9 | #ifndef APPLICATION_NAME 10 | #define APPLICATION_NAME "neutronapp" 11 | #endif 12 | 13 | #ifndef SHOULD_OPEN_IN_DEFAULT_BROWSER 14 | #define SHOULD_OPEN_IN_DEFAULT_BROWSER true 15 | #endif -------------------------------------------------------------------------------- /src/launch-app/src/platform_specific.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "running_guard.hpp" 4 | #if defined(__APPLE__) 5 | #include "tray_mac.hpp" 6 | #else 7 | #include "tray.hpp" 8 | #endif 9 | 10 | #include 11 | 12 | namespace platform_specific { 13 | void move_open_in_default_browser_script(std::filesystem::path appDir); 14 | void clean_open_in_default_browser_script(); 15 | Tray::Tray *setup_tray(std::filesystem::path appDir, running_guard::guard &instance_guard, bool &window_state, bool &should_exit); 16 | } 17 | -------------------------------------------------------------------------------- /src/launch-app/src/running_guard.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "running_guard.hpp" 8 | 9 | namespace running_guard { 10 | guard::guard(std::string name) : name(name){ 11 | try { 12 | guard::semaphore = new boost::interprocess::named_semaphore(boost::interprocess::create_only_t(), name.c_str(), 0); 13 | guard::otherProgramExists = false; 14 | } catch (boost::interprocess::interprocess_exception &e){ 15 | guard::semaphore = new boost::interprocess::named_semaphore(boost::interprocess::open_only_t(), name.c_str()); 16 | guard::otherProgramExists = true; 17 | } 18 | 19 | if (otherProgramExists){ 20 | guard::semaphore->post(); 21 | } 22 | } 23 | 24 | guard::~guard() { 25 | if (!otherProgramExists || guard::semaphore->try_wait()) 26 | boost::interprocess::named_semaphore::remove(guard::name.c_str()); 27 | } 28 | 29 | void guard::waitForOtherProgram(){ 30 | guard::semaphore->wait(); 31 | return; 32 | } 33 | 34 | void guard::disarm(){ 35 | while (!guard::semaphore->try_wait()){ 36 | guard::semaphore->post(); 37 | } 38 | return; 39 | } 40 | } -------------------------------------------------------------------------------- /src/launch-app/src/running_guard.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | 9 | namespace running_guard 10 | { 11 | class guard 12 | { 13 | public: 14 | std::string name; 15 | bool otherProgramExists; 16 | 17 | private: 18 | boost::interprocess::named_semaphore *semaphore; 19 | 20 | public: 21 | ~guard(); 22 | explicit guard(std::string name); 23 | 24 | public: 25 | void waitForOtherProgram(); 26 | void disarm(); 27 | }; 28 | } -------------------------------------------------------------------------------- /src/launch-app/src/tray_mac.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | namespace Tray{ 3 | class Tray { 4 | public: 5 | void run(){}; 6 | void update(){}; 7 | void exit(){}; 8 | }; 9 | } -------------------------------------------------------------------------------- /src/launch-app/src/windows.cpp: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | 4 | #include "platform_specific.hpp" 5 | #include "placeholders.hpp" 6 | #include "running_guard.hpp" 7 | #include "tray.hpp" 8 | 9 | 10 | void platform_specific::move_open_in_default_browser_script(std::filesystem::path appDir){ 11 | return; 12 | } 13 | 14 | void platform_specific::clean_open_in_default_browser_script(){ 15 | return; 16 | } 17 | 18 | Tray::Tray *platform_specific::setup_tray(std::filesystem::path appDir, running_guard::guard &instance_guard, bool& window_state, bool &should_exit){ 19 | Tray::Tray *tray = new Tray::Tray(APPLICATION_NAME, (appDir/(std::string(APPLICATION_NAME) + std::string(".ico"))).u8string()); 20 | tray->addEntry(Tray::SyncedToggle("Show Window", window_state, NULL)); 21 | tray->addEntry(Tray::Button("Exit", [&]{should_exit = true;})); 22 | 23 | return tray; 24 | } 25 | 26 | #endif -------------------------------------------------------------------------------- /src/mac/Info-aarch64.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | launch-app 9 | CFBundleGetInfoString 10 | NEUTRON_APP_NAME NEUTRON_APP_VERSION 11 | CFBundleIconFile 12 | firefox.icns 13 | CFBundleIdentifier 14 | org.neutron.NEUTRON_INTERNAL_APP_NAME 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | NEUTRON_APP_NAME 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | NEUTRON_APP_VERSION 23 | CFBundleSignature 24 | MOZB 25 | CFBundleVersion 26 | 12224.2.1 27 | NSUserActivityTypes 28 | 29 | NSUserActivityTypeBrowsingWeb 30 | 31 | NSAppleScriptEnabled 32 | 33 | LSApplicationCategoryType 34 | public.app-category.productivity 35 | LSEnvironment 36 | 37 | MallocNanoZone 38 | 0 39 | SYSTEM_VERSION_COMPAT 40 | 0 41 | 42 | LSFileQuarantineEnabled 43 | 44 | LSMinimumSystemVersion 45 | 10.15.0 46 | NSSupportsAutomaticGraphicsSwitching 47 | 48 | NSRequiresAquaSystemAppearance 49 | 50 | NSPrincipalClass 51 | GeckoNSApplication 52 | SMPrivilegedExecutables 53 | 54 | org.mozilla.updater 55 | identifier "org.mozilla.updater" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.OU] = "43AQ936H96" 56 | 57 | MozillaDeveloperRepoPath 58 | /mnt/nvme/neutron/build/mozilla-unified 59 | MozillaDeveloperObjPath 60 | /mnt/nvme/neutron/build/mozilla-unified/obj-aarch64-apple-darwin 61 | 62 | NSCameraUsageDescription 63 | Only sites you allow within NEUTRON_APP_NAME will be able to use the camera. 64 | 65 | NSMicrophoneUsageDescription 66 | Only sites you allow within NEUTRON_APP_NAME will be able to use the microphone. 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/mac/Info-x86_64.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | launch-app 9 | CFBundleGetInfoString 10 | NEUTRON_APP_NAME NEUTRON_APP_VERSION 11 | CFBundleIconFile 12 | firefox.icns 13 | CFBundleIdentifier 14 | org.neutron.NEUTRON_INTERNAL_APP_NAME 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | NEUTRON_APP_NAME 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | NEUTRON_APP_VERSION 23 | CFBundleSignature 24 | MOZB 25 | CFBundleVersion 26 | 12224.2.1 27 | NSUserActivityTypes 28 | 29 | NSUserActivityTypeBrowsingWeb 30 | 31 | NSAppleScriptEnabled 32 | 33 | LSApplicationCategoryType 34 | public.app-category.productivity 35 | LSEnvironment 36 | 37 | MallocNanoZone 38 | 0 39 | SYSTEM_VERSION_COMPAT 40 | 0 41 | 42 | LSFileQuarantineEnabled 43 | 44 | LSMinimumSystemVersion 45 | 10.15.0 46 | NSSupportsAutomaticGraphicsSwitching 47 | 48 | NSRequiresAquaSystemAppearance 49 | 50 | NSPrincipalClass 51 | GeckoNSApplication 52 | SMPrivilegedExecutables 53 | 54 | org.mozilla.updater 55 | identifier "org.mozilla.updater" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.OU] = "43AQ936H96" 56 | 57 | MozillaDeveloperRepoPath 58 | /mnt/nvme/neutron/build/mozilla-unified 59 | MozillaDeveloperObjPath 60 | /mnt/nvme/neutron/build/mozilla-unified/obj-x86_64-apple-darwin 61 | 62 | NSCameraUsageDescription 63 | Only sites you allow within NEUTRON_APP_NAME will be able to use the camera. 64 | 65 | NSMicrophoneUsageDescription 66 | Only sites you allow within NEUTRON_APP_NAME will be able to use the microphone. 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/mac/close-on-window-closed.patch: -------------------------------------------------------------------------------- 1 | diff --git a/toolkit/xre/MacApplicationDelegate.mm b/toolkit/xre/MacApplicationDelegate.mm 2 | index ca99497624e9a..cdcde046d42a3 100644 3 | --- a/toolkit/xre/MacApplicationDelegate.mm 4 | +++ b/toolkit/xre/MacApplicationDelegate.mm 5 | @@ -204,6 +204,11 @@ nsTArray TakeStartupURLs() { return std::move(StartupURLs()); } 6 | return YES; 7 | } 8 | 9 | + -(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)sender 10 | + { 11 | + return YES; 12 | + } 13 | + 14 | // Create the menu that shows up in the Dock. 15 | - (NSMenu*)applicationDockMenu:(NSApplication*)sender { 16 | NS_OBJC_BEGIN_TRY_BLOCK_RETURN; 17 | -------------------------------------------------------------------------------- /src/mozconfig.linux: -------------------------------------------------------------------------------- 1 | ac_add_options --with-app-name=NEUTRON_INTERNAL_APP_NAME 2 | ac_add_options --with-branding=browser/branding/NEUTRON_INTERNAL_APP_NAME 3 | 4 | ac_add_options --with-unsigned-addon-scopes=app,system 5 | export MOZ_REQUIRE_SIGNING= 6 | 7 | export MOZ_APP_NAME=NEUTRON_INTERNAL_APP_NAME 8 | export MOZ_APP_BASENAME=NEUTRON_APP_NAME 9 | export MOZ_APP_PROFILE=NEUTRON_INTERNAL_APP_NAME 10 | export MOZ_APP_VENDOR=NEUTRON_APP_NAME 11 | export MOZ_APP_DISPLAYNAME=NEUTRON_APP_NAME 12 | export MOZ_APP_UA_NAME=Firefox -------------------------------------------------------------------------------- /src/mozconfig.linux-aarch64: -------------------------------------------------------------------------------- 1 | ac_add_options --target=aarch64-linux-gnu 2 | ac_add_options --enable-bootstrap 3 | 4 | ac_add_options --with-app-name=NEUTRON_INTERNAL_APP_NAME 5 | ac_add_options --with-branding=browser/branding/NEUTRON_INTERNAL_APP_NAME 6 | 7 | ac_add_options --with-unsigned-addon-scopes=app,system 8 | export MOZ_REQUIRE_SIGNING= 9 | 10 | export MOZ_APP_NAME=NEUTRON_INTERNAL_APP_NAME 11 | export MOZ_APP_BASENAME=NEUTRON_APP_NAME 12 | export MOZ_APP_PROFILE=NEUTRON_INTERNAL_APP_NAME 13 | export MOZ_APP_VENDOR=NEUTRON_APP_NAME 14 | export MOZ_APP_DISPLAYNAME=NEUTRON_APP_NAME 15 | export MOZ_APP_UA_NAME=Firefox -------------------------------------------------------------------------------- /src/mozconfig.mac-arm: -------------------------------------------------------------------------------- 1 | ac_add_options --target=aarch64-apple-darwin 2 | ac_add_options --enable-bootstrap 3 | 4 | ac_add_options --with-app-name=NEUTRON_INTERNAL_APP_NAME 5 | ac_add_options --with-branding=browser/branding/NEUTRON_INTERNAL_APP_NAME 6 | 7 | ac_add_options --with-unsigned-addon-scopes=app,system 8 | export MOZ_REQUIRE_SIGNING= 9 | 10 | export MOZ_APP_NAME=NEUTRON_INTERNAL_APP_NAME 11 | export MOZ_APP_BASENAME=NEUTRON_APP_NAME 12 | export MOZ_APP_PROFILE=NEUTRON_INTERNAL_APP_NAME 13 | export MOZ_APP_VENDOR=NEUTRON_APP_NAME 14 | export MOZ_APP_DISPLAYNAME=NEUTRON_APP_NAME 15 | export MOZ_APP_UA_NAME=Firefox 16 | -------------------------------------------------------------------------------- /src/mozconfig.mac-intel: -------------------------------------------------------------------------------- 1 | ac_add_options --target=x86_64-apple-darwin 2 | ac_add_options --enable-bootstrap 3 | 4 | ac_add_options --with-app-name=NEUTRON_INTERNAL_APP_NAME 5 | ac_add_options --with-branding=browser/branding/NEUTRON_INTERNAL_APP_NAME 6 | 7 | ac_add_options --with-unsigned-addon-scopes=app,system 8 | export MOZ_REQUIRE_SIGNING= 9 | 10 | export MOZ_APP_NAME=NEUTRON_INTERNAL_APP_NAME 11 | export MOZ_APP_BASENAME=NEUTRON_APP_NAME 12 | export MOZ_APP_PROFILE=NEUTRON_INTERNAL_APP_NAME 13 | export MOZ_APP_VENDOR=NEUTRON_APP_NAME 14 | export MOZ_APP_DISPLAYNAME=NEUTRON_APP_NAME 15 | export MOZ_APP_UA_NAME=Firefox 16 | -------------------------------------------------------------------------------- /src/mozconfig.windows: -------------------------------------------------------------------------------- 1 | # mozbuild is defined in crossCompileForWindows.sh 2 | export WINSYSROOT="$mozbuild/win-cross/vs" 3 | 4 | # Cross compile stuff 5 | mk_add_options "export LOWERCASE_DIRS=$mozbuild/win-cross" 6 | 7 | EXTRA_PATH="$mozbuild/win-cross/vs/vc/tools/msvc/14.29.30133/bin/hostx64/x64:" 8 | mk_add_options "export PATH=$EXTRA_PATH$PATH" 9 | 10 | export CC="$mozbuild/clang/bin/clang-cl" 11 | export CXX="$mozbuild/clang/bin/clang-cl" 12 | export HOST_CC="$mozbuild/clang/bin/clang" 13 | export HOST_CXX="$mozbuild/clang/bin/clang++" 14 | 15 | export WINE="$mozbuild/wine/bin/wine64" 16 | #export MIDL="$mozbuild/wine/bin/widl" 17 | 18 | ac_add_options --target=x86_64-pc-mingw32 19 | #ac_add_options --disable-bootstrap 20 | ac_add_options --enable-application=browser 21 | 22 | # Normal build stuff 23 | ac_add_options --with-app-name=NEUTRON_INTERNAL_APP_NAME 24 | ac_add_options --with-branding=browser/branding/NEUTRON_INTERNAL_APP_NAME 25 | 26 | ac_add_options --with-unsigned-addon-scopes=app,system 27 | export MOZ_REQUIRE_SIGNING= 28 | 29 | export MOZ_APP_NAME=NEUTRON_INTERNAL_APP_NAME 30 | export MOZ_APP_BASENAME=NEUTRON_APP_NAME 31 | export MOZ_APP_PROFILE=NEUTRON_INTERNAL_APP_NAME 32 | export MOZ_APP_VENDOR=NEUTRON_APP_NAME 33 | export MOZ_APP_DISPLAYNAME=NEUTRON_APP_NAME 34 | export MOZ_APP_UA_NAME=Firefox -------------------------------------------------------------------------------- /src/mozilla_dirsFromLibreWolf.patch: -------------------------------------------------------------------------------- 1 | --- a/toolkit/xre/nsXREDirProvider.cpp 2 | +++ b/toolkit/xre/nsXREDirProvider.cpp 3 | @@ -300,16 +300,16 @@ static nsresult GetSystemParentDirectory(nsIFile** aFile) { 4 | rv = GetOSXFolderType(kOnSystemDisk, kApplicationSupportFolderType, 5 | getter_AddRefs(localDir)); 6 | if (NS_SUCCEEDED(rv)) { 7 | - rv = localDir->AppendNative("Mozilla"_ns); 8 | + rv = localDir->AppendNative("NEUTRON_APP_NAME"_ns); 9 | } 10 | # else 11 | constexpr auto dirname = 12 | # ifdef HAVE_USR_LIB64_DIR 13 | - "/usr/lib64/mozilla"_ns 14 | + "/usr/lib64/NEUTRON_INTERNAL_APP_NAME"_ns 15 | # elif defined(__OpenBSD__) || defined(__FreeBSD__) 16 | - "/usr/local/lib/mozilla"_ns 17 | + "/usr/local/lib/NEUTRON_INTERNAL_APP_NAME"_ns 18 | # else 19 | - "/usr/lib/mozilla"_ns 20 | + "/usr/lib/NEUTRON_INTERNAL_APP_NAME"_ns 21 | # endif 22 | ; 23 | rv = NS_NewNativeLocalFile(dirname, false, getter_AddRefs(localDir)); 24 | @@ -371,9 +371,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, 25 | rv = GetUserDataDirectoryHome(getter_AddRefs(file), false); 26 | NS_ENSURE_SUCCESS(rv, rv); 27 | # if defined(XP_MACOSX) 28 | - rv = file->AppendNative("Mozilla"_ns); 29 | + rv = file->AppendNative("NEUTRON_APP_NAME"_ns); 30 | # else // defined(XP_MACOSX) 31 | - rv = file->AppendNative(".mozilla"_ns); 32 | + rv = file->AppendNative(".NEUTRON_INTERNAL_APP_NAME"_ns); 33 | # endif // defined(XP_MACOSX) 34 | } 35 | #endif // defined(XP_UNIX) || defined(XP_MACOSX) 36 | @@ -411,9 +411,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, 37 | else if (!strcmp(aProperty, XRE_SYS_SHARE_EXTENSION_PARENT_DIR)) { 38 | # ifdef ENABLE_SYSTEM_EXTENSION_DIRS 39 | # if defined(__OpenBSD__) || defined(__FreeBSD__) 40 | - static const char* const sysLExtDir = "/usr/local/share/mozilla/extensions"; 41 | + static const char* const sysLExtDir = "/usr/local/share/NEUTRON_INTERNAL_APP_NAME/extensions"; 42 | # else 43 | - static const char* const sysLExtDir = "/usr/share/mozilla/extensions"; 44 | + static const char* const sysLExtDir = "/usr/share/NEUTRON_INTERNAL_APP_NAME/extensions"; 45 | # endif 46 | rv = NS_NewNativeLocalFile(nsDependentCString(sysLExtDir), false, 47 | getter_AddRefs(file)); 48 | @@ -1114,7 +1114,7 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult, 49 | nsDependentCString(hasVendor ? GetAppVendor() : GetAppName())))) { 50 | return NS_ERROR_FAILURE; 51 | } 52 | - } else if (NS_FAILED(localDir->AppendNative("Mozilla"_ns))) { 53 | + } else if (NS_FAILED(localDir->AppendNative("NEUTRON_APP_NAME"_ns))) { 54 | return NS_ERROR_FAILURE; 55 | } 56 | 57 | @@ -1363,7 +1363,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) { 58 | 59 | #if defined(XP_MACOSX) || defined(XP_WIN) 60 | 61 | - static const char* const sXR = "Mozilla"; 62 | + static const char* const sXR = "NEUTRON_APP_NAME"; 63 | rv = aFile->AppendNative(nsDependentCString(sXR)); 64 | NS_ENSURE_SUCCESS(rv, rv); 65 | 66 | @@ -1373,7 +1373,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) { 67 | 68 | #elif defined(XP_UNIX) 69 | 70 | - static const char* const sXR = ".mozilla"; 71 | + static const char* const sXR = ".NEUTRON_INTERNAL_APP_NAME"; 72 | rv = aFile->AppendNative(nsDependentCString(sXR)); 73 | NS_ENSURE_SUCCESS(rv, rv); 74 | 75 | -------------------------------------------------------------------------------- /src/open-in-default-browser/README.md: -------------------------------------------------------------------------------- 1 | # open-in-default-browser 2 | A firefox extension to open all websites in the default browser. This is used by neutron. 3 | -------------------------------------------------------------------------------- /src/open-in-default-browser/builtin-open-in-default-browser.patch: -------------------------------------------------------------------------------- 1 | diff --git a/moz.build b/moz.build 2 | index 3c6e7eb886892..32fccb3d1c404 100644 3 | --- a/browser/extensions/moz.build 4 | +++ b/browser/extensions/moz.build 5 | @@ -11,4 +11,5 @@ DIRS += [ 6 | "report-site-issue", 7 | "pictureinpicture", 8 | "search-detection", 9 | + "open-in-default-browser", 10 | ] 11 | -------------------------------------------------------------------------------- /src/open-in-default-browser/makefile: -------------------------------------------------------------------------------- 1 | extension: 2 | web-ext build -s open-in-default-browser-ext -o 3 | mv web-ext-artifacts/open_in_default_browser-1.0.zip . -------------------------------------------------------------------------------- /src/open-in-default-browser/open-in-default-browser: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #If you want to use a specific browser, change this to the executable of that. xdg-open opens in your default browser. 3 | browser="xdg-open" 4 | 5 | $browser $(echo $1 | sed "s/open\://g") -------------------------------------------------------------------------------- /src/open-in-default-browser/open-in-default-browser-ext/extension/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "manifest_version": 2, 4 | "name": "open in default browser", 5 | "version": "1.0", 6 | 7 | "description": "Open all links in default browser", 8 | 9 | "content_scripts": [ 10 | { 11 | "matches": [""], 12 | "js": ["replaceLinks.js"], 13 | "all_frames": true 14 | } 15 | ], 16 | 17 | "browser_specific_settings": { 18 | "gecko": { 19 | "id": "open-in-default-browser@sanghai.org", 20 | "strict_min_version": "1.0" 21 | } 22 | }, 23 | 24 | "permissions": [ 25 | "activeTab" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /src/open-in-default-browser/open-in-default-browser-ext/extension/replaceLinks.js: -------------------------------------------------------------------------------- 1 | setInterval(changeLinks, 100) 2 | 3 | const exclude = new RegExp("NEUTRON_EXCLUDE_REGEX_PATTERN") 4 | 5 | function changeLinks() { 6 | // Get list of all links in the page 7 | var links = document.getElementsByTagName("a"); 8 | // Loop through links 9 | for(var i=0,l=links.length; i None: 10 | with open(filePath, "r") as f: 11 | data = f.read() 12 | 13 | data = data.replace(old, new) 14 | 15 | with open(filePath, "w") as f: 16 | f.write(data) 17 | 18 | def build(component: str) -> bool: 19 | if component not in os.listdir("src/scripts/build"): 20 | print(f"Neutron does not support building for {component}.") 21 | return False 22 | 23 | completed = subprocess.run(f"src/scripts/build/{component}") 24 | if completed.returncode == 0: 25 | print(f"Build for {component} success!") 26 | return True 27 | else: 28 | print(f"Build for {component} failed!") 29 | return False 30 | 31 | def main(): 32 | with open("config.json", "r") as f: 33 | appinfo = json.load(f) 34 | 35 | # Make changes to firefox 36 | 37 | # Create branding 38 | shutil.copytree("src/branding-template", f"src/changed/browser/branding/{appinfo['internalAppName']}", dirs_exist_ok=True) 39 | 40 | # List of icons that need to be created 41 | pngIcons = { 42 | f"src/changed/browser/branding/{appinfo['internalAppName']}/default16.png": 16, 43 | f"src/changed/browser/branding/{appinfo['internalAppName']}/default22.png": 22, 44 | f"src/changed/browser/branding/{appinfo['internalAppName']}/default24.png": 24, 45 | f"src/changed/browser/branding/{appinfo['internalAppName']}/default32.png": 32, 46 | f"src/changed/browser/branding/{appinfo['internalAppName']}/default48.png": 48, 47 | f"src/changed/browser/branding/{appinfo['internalAppName']}/default64.png": 64, 48 | f"src/changed/browser/branding/{appinfo['internalAppName']}/default128.png": 128, 49 | f"src/changed/browser/branding/{appinfo['internalAppName']}/default256.png": 256, 50 | f"src/changed/browser/branding/{appinfo['internalAppName']}/VisualElements_70.png": 70, 51 | f"src/changed/browser/branding/{appinfo['internalAppName']}/VisualElements_150.png": 150, 52 | f"src/changed/browser/branding/{appinfo['internalAppName']}/msix/Assets/SmallTile.scale-200.png": 96, 53 | f"src/changed/browser/branding/{appinfo['internalAppName']}/msix/Assets/LargeTile.scale-200.png": 256, 54 | f"src/changed/browser/branding/{appinfo['internalAppName']}/msix/Assets/Square150x150Logo.scale-200.png": 150, 55 | f"src/changed/browser/branding/{appinfo['internalAppName']}/msix/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png": 256, 56 | f"src/changed/browser/branding/{appinfo['internalAppName']}/msix/Assets/Square44x44Logo.altform-unplated_targetsize-256.png": 256, 57 | f"src/changed/browser/branding/{appinfo['internalAppName']}/msix/Assets/Square44x44Logo.scale-200.png": 256, 58 | f"src/changed/browser/branding/{appinfo['internalAppName']}/msix/Assets/Square44x44Logo.targetsize-256.png": 256, 59 | f"src/changed/browser/branding/{appinfo['internalAppName']}/msix/Assets/StoreLogo.scale-200.png": 256, 60 | f"src/packages/appimage/neutron.AppImage/.DirIcon": 256, 61 | f"src/packages/appimage/neutron.AppImage/icon256.png": 256, 62 | f"src/packages/appimage/neutron.AppImage/usr/share/icons/{appinfo['internalAppName']}256.png": 256, 63 | } 64 | icoIcons = { 65 | f"src/changed/browser/branding/{appinfo['internalAppName']}/firefox64.ico": [256,128,64,48,32,24,22,16], 66 | f"src/changed/browser/branding/{appinfo['internalAppName']}/firefox.ico": [256,128,64,48,32,24,22,16], 67 | f"src/windows/{appinfo['internalAppName']}.ico": [256,128,64,48,32,24,22,16] 68 | } 69 | icnsIcons = { 70 | f"src/changed/browser/branding/{appinfo['internalAppName']}/firefox.icns": 512 71 | } 72 | 73 | for path, size in pngIcons.items(): 74 | svg2png(url=appinfo["logoSvgFilePath"], write_to=path, output_height=size, output_width=size) 75 | 76 | im = Image.open(f"src/changed/browser/branding/{appinfo['internalAppName']}/default256.png") 77 | 78 | for path, sizes in icoIcons.items(): 79 | im.save(path, sizes=[(x, x) for x in sizes], bitmap_format="bmp") 80 | 81 | # Make banner 82 | im = Image.open(f"src/changed/browser/branding/{appinfo['internalAppName']}/default128.png") 83 | 84 | banner = Image.new(size=(164, 314), color="white", mode="RGBA") 85 | # (164/2)-64=18 and (314/2)-64=93 86 | banner.paste(im, (18, 93), im) 87 | banner.save("src/windows/banner.bmp", bitmap_format="bmp") 88 | 89 | for path, size in icnsIcons.items(): 90 | svg2png(url=appinfo["logoSvgFilePath"], write_to="temp.png", output_height=size, output_width=size) 91 | im = Image.open("temp.png") 92 | im.save(path) 93 | os.remove("temp.png") 94 | 95 | # # Create the disk icon that shows up when you mount the dmg 96 | # im = Image.open(f"src/changed/browser/branding/{appinfo['internalAppName']}/disk.icns") 97 | 98 | # I made changes to the config format so lets fix old configs. 99 | if "NEUTRON_OPEN_IN_DEFAULT_BROWSER_EXTENSION_LOCATION" in appinfo["extensionURLs"]: 100 | appinfo["extensionURLs"].remove("NEUTRON_OPEN_IN_DEFAULT_BROWSER_EXTENSION_LOCATION") 101 | 102 | # Replace placeholders with actual info 103 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/pref/firefox-branding.js", "NEUTRON_APP_URL", appinfo["url"]) 104 | 105 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/configure.sh", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 106 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/configure.sh", "NEUTRON_APP_NAME", appinfo["appName"]) 107 | 108 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/locales/en-US/brand.properties", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 109 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/locales/en-US/brand.properties", "NEUTRON_APP_NAME", appinfo["appName"]) 110 | 111 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/locales/en-US/brand.dtd", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 112 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/locales/en-US/brand.dtd", "NEUTRON_APP_NAME", appinfo["appName"]) 113 | 114 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/locales/en-US/brand.ftl", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 115 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/locales/en-US/brand.ftl", "NEUTRON_APP_NAME", appinfo["appName"]) 116 | 117 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/branding.nsi", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 118 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/branding.nsi", "NEUTRON_APP_NAME", appinfo["appName"]) 119 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/branding.nsi", "NEUTRON_PROJECT_URL", appinfo["projectURL"]) 120 | replaceTextInFile(f"src/changed/browser/branding/{appinfo['internalAppName']}/branding.nsi", "NEUTRON_PROJECT_HELP_URL", appinfo["projectHelpURL"]) 121 | 122 | replaceTextInFile("src/mozconfig.linux", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 123 | replaceTextInFile("src/mozconfig.linux", "NEUTRON_APP_NAME", appinfo["appName"]) 124 | replaceTextInFile("src/mozconfig.linux-aarch64", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 125 | replaceTextInFile("src/mozconfig.linux-aarch64", "NEUTRON_APP_NAME", appinfo["appName"]) 126 | replaceTextInFile("src/mozconfig.windows", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 127 | replaceTextInFile("src/mozconfig.windows", "NEUTRON_APP_NAME", appinfo["appName"]) 128 | replaceTextInFile("src/mozconfig.mac-arm", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 129 | replaceTextInFile("src/mozconfig.mac-arm", "NEUTRON_APP_NAME", appinfo["appName"]) 130 | replaceTextInFile("src/mozconfig.mac-intel", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 131 | replaceTextInFile("src/mozconfig.mac-intel", "NEUTRON_APP_NAME", appinfo["appName"]) 132 | 133 | replaceTextInFile("src/scripts/build/launch-app-linux", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(appinfo["openInDefaultBrowser"]).lower()) 134 | replaceTextInFile("src/scripts/build/launch-app-linux", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 135 | replaceTextInFile("src/scripts/build/launch-app-linux", "NEUTRON_SHOULD_RUN_IN_BACKGROUND", str(appinfo["runInBackground"]).lower()) 136 | 137 | replaceTextInFile("src/scripts/build/launch-app-linux-aarch64", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(appinfo["openInDefaultBrowser"]).lower()) 138 | replaceTextInFile("src/scripts/build/launch-app-linux-aarch64", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 139 | replaceTextInFile("src/scripts/build/launch-app-linux-aarch64", "NEUTRON_SHOULD_RUN_IN_BACKGROUND", str(appinfo["runInBackground"]).lower()) 140 | 141 | replaceTextInFile("src/scripts/build/launch-app-windows", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(appinfo["openInDefaultBrowser"]).lower()) 142 | replaceTextInFile("src/scripts/build/launch-app-windows", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 143 | replaceTextInFile("src/scripts/build/launch-app-windows", "NEUTRON_SHOULD_RUN_IN_BACKGROUND", str(appinfo["runInBackground"]).lower()) 144 | 145 | replaceTextInFile("src/scripts/build/launch-app-mac-arm", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(appinfo["openInDefaultBrowser"]).lower()) 146 | replaceTextInFile("src/scripts/build/launch-app-mac-arm", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 147 | replaceTextInFile("src/scripts/build/launch-app-mac-arm", "NEUTRON_SHOULD_RUN_IN_BACKGROUND", str(appinfo["runInBackground"]).lower()) 148 | 149 | replaceTextInFile("src/scripts/build/launch-app-mac-intel", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(appinfo["openInDefaultBrowser"]).lower()) 150 | replaceTextInFile("src/scripts/build/launch-app-mac-intel", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 151 | replaceTextInFile("src/scripts/build/launch-app-mac-intel", "NEUTRON_SHOULD_RUN_IN_BACKGROUND", str(appinfo["runInBackground"]).lower()) 152 | 153 | replaceTextInFile("src/windows/app.rc", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 154 | 155 | replaceTextInFile("src/mac/Info-aarch64.plist", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 156 | replaceTextInFile("src/mac/Info-aarch64.plist", "NEUTRON_APP_NAME", appinfo["appName"]) 157 | replaceTextInFile("src/mac/Info-aarch64.plist", "NEUTRON_APP_VERSION", appinfo["version"]) 158 | 159 | replaceTextInFile("src/mac/Info-x86_64.plist", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 160 | replaceTextInFile("src/mac/Info-x86_64.plist", "NEUTRON_APP_NAME", appinfo["appName"]) 161 | replaceTextInFile("src/mac/Info-x86_64.plist", "NEUTRON_APP_VERSION", appinfo["version"]) 162 | 163 | if appinfo["openInDefaultBrowser"]: 164 | replaceTextInFile("src/open-in-default-browser/open-in-default-browser-ext/extension/replaceLinks.js", "NEUTRON_EXCLUDE_REGEX_PATTERN", appinfo["openInDefaultBrowserRegex"]) 165 | 166 | replaceTextInFile("src/windows/setup.nsi", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 167 | replaceTextInFile("src/windows/setup.nsi", "NEUTRON_APP_NAME", appinfo["appName"]) 168 | replaceTextInFile("src/windows/setup.nsi", "NEUTRON_APP_VERSION", appinfo["version"]) 169 | 170 | replaceTextInFile("src/mozilla_dirsFromLibreWolf.patch", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 171 | replaceTextInFile("src/mozilla_dirsFromLibreWolf.patch", "NEUTRON_APP_NAME", appinfo["appName"]) 172 | 173 | replaceTextInFile("src/distribution/policies-windows.json", "NEUTRON_APP_NAME", appinfo["appName"]) 174 | replaceTextInFile("src/distribution/policies-windows.json", "NEUTRON_EXTENSION_URLS", str(appinfo["extensionURLs"]).replace("'", '"')) 175 | 176 | replaceTextInFile("src/distribution/policies-linux.json", "NEUTRON_EXTENSION_URLS", str(appinfo["extensionURLs"]).replace("'", '"')) 177 | 178 | replaceTextInFile("src/distribution/policies-linux-appimage.json", "NEUTRON_EXTENSION_URLS", str(appinfo["extensionURLs"]).replace("'", '"')) 179 | 180 | replaceTextInFile("src/distribution/policies-flatpak.json", "NEUTRON_EXTENSION_URLS", str(appinfo["extensionURLs"]).replace("'", '"')) 181 | 182 | replaceTextInFile("src/scripts/build/linux", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 183 | replaceTextInFile("src/scripts/build/linux", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(int(appinfo["runInBackground"]))) 184 | 185 | replaceTextInFile("src/scripts/build/linux-aarch64", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 186 | replaceTextInFile("src/scripts/build/linux-aarch64", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(int(appinfo["runInBackground"]))) 187 | 188 | replaceTextInFile("src/scripts/build/windows", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 189 | replaceTextInFile("src/scripts/build/windows", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(int(appinfo["runInBackground"]))) 190 | 191 | replaceTextInFile("src/scripts/build/mac-arm", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 192 | replaceTextInFile("src/scripts/build/mac-arm", "NEUTRON_APP_NAME", appinfo["appName"]) 193 | replaceTextInFile("src/scripts/build/mac-arm", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(int(appinfo["runInBackground"]))) 194 | 195 | replaceTextInFile("src/scripts/build/mac-intel", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 196 | replaceTextInFile("src/scripts/build/mac-intel", "NEUTRON_APP_NAME", appinfo["appName"]) 197 | replaceTextInFile("src/scripts/build/mac-intel", "NEUTRON_OPEN_IN_DEFAULT_BROWSER", str(int(appinfo["runInBackground"]))) 198 | 199 | replaceTextInFile("src/packages/appimage/neutron.AppImage/neutron.desktop", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 200 | replaceTextInFile("src/packages/appimage/neutron.AppImage/neutron.desktop", "NEUTRON_APP_NAME", appinfo["appName"]) 201 | 202 | replaceTextInFile("src/packages/appimage/neutron.AppImage/AppRun", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 203 | replaceTextInFile("src/packages/appimage/neutron.AppImage/AppRun", "NEUTRON_APP_NAME", appinfo["appName"]) 204 | 205 | replaceTextInFile("src/scripts/build/appimage", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 206 | replaceTextInFile("src/scripts/build/appimage", "NEUTRON_APP_NAME", appinfo["appName"]) 207 | 208 | replaceTextInFile("src/scripts/build/appimage-aarch64", "NEUTRON_INTERNAL_APP_NAME", appinfo["internalAppName"]) 209 | replaceTextInFile("src/scripts/build/appimage-aarch64", "NEUTRON_APP_NAME", appinfo["appName"]) 210 | 211 | # Finally, lets start building. 212 | if not build("download-firefox-source"): 213 | print("Couldn't download the Firefox source code.") 214 | exit(1) 215 | 216 | if appinfo["openInDefaultBrowser"]: 217 | if not build("open-in-default-browser"): 218 | print("Error building open-in-default-browser extension!") 219 | exit(1) 220 | 221 | if "linux" in appinfo["platforms"]: 222 | if not build("launch-app-linux"): 223 | print("Error building launch-app-linux!") 224 | exit(1) 225 | 226 | if "linux-aarch64" in appinfo["platforms"]: 227 | if not build("launch-app-linux-aarch64"): 228 | print("Error building launch-app-linux-aarch64!") 229 | exit(1) 230 | 231 | if "windows" in appinfo["platforms"]: 232 | if not build("launch-app-windows"): 233 | print("Error building launch-app-windows!") 234 | exit(1) 235 | 236 | if "mac-arm" in appinfo["platforms"]: 237 | if not build("launch-app-mac-arm"): 238 | print("Error building launch-app-mac-arm") 239 | exit(1) 240 | 241 | if "mac-intel" in appinfo["platforms"]: 242 | if not build("launch-app-mac-intel"): 243 | print("Error building launch-app-mac-intel") 244 | exit(1) 245 | 246 | # If we build appimage but not linux 247 | if "appimage" in appinfo["platforms"] and "linux" not in appinfo["platforms"]: 248 | appinfo["platforms"].insert(appinfo["platforms"].index("appimage"), "linux") 249 | 250 | if "appimage-aarch64" in appinfo["platforms"] and "linux-aarch64" not in appinfo["platforms"]: 251 | appinfo["platforms"].insert(appinfo["platforms"].index("appimage-aarch64"), "linux-aarch64") 252 | 253 | for component in appinfo["platforms"]: 254 | if not build(component): 255 | print(f"Error building component {component}!") 256 | exit(1) 257 | 258 | print("Done Building!") 259 | return 260 | 261 | if __name__ == "__main__": 262 | main() 263 | -------------------------------------------------------------------------------- /src/scripts/build/appimage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -r NEUTRON_INTERNAL_APP_NAME.AppImage 4 | cp -r src/packages/appimage/neutron.AppImage NEUTRON_INTERNAL_APP_NAME.AppImage 5 | mv NEUTRON_INTERNAL_APP_NAME.AppImage/neutron.desktop NEUTRON_INTERNAL_APP_NAME.AppImage/NEUTRON_INTERNAL_APP_NAME.desktop 6 | mkdir -p NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME 7 | tar --strip-components=1 -xvf datcord-linux-x86_64.tar.bz2 -C NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/ 8 | cp -r src/distribution/ NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/ 9 | mv NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/distribution/policies-linux-appimage.json NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/distribution/policies.json 10 | cp src/open-in-default-browser/open-in-default-browser NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/ 11 | cp src/open-in-default-browser/open_in_default_browser-1.0.zip NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/ 12 | 13 | ARCH=x86_64 appimagetool NEUTRON_INTERNAL_APP_NAME.AppImage/ 14 | -------------------------------------------------------------------------------- /src/scripts/build/appimage-aarch64: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -r NEUTRON_INTERNAL_APP_NAME.AppImage 4 | cp -r src/packages/appimage/neutron.AppImage NEUTRON_INTERNAL_APP_NAME.AppImage 5 | mv NEUTRON_INTERNAL_APP_NAME.AppImage/neutron.desktop NEUTRON_INTERNAL_APP_NAME.AppImage/NEUTRON_INTERNAL_APP_NAME.desktop 6 | mkdir -p NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME 7 | tar --strip-components=1 -xvf datcord-linux-aarch64.tar.bz2 -C NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/ 8 | cp -r src/distribution/ NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/ 9 | mv NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/distribution/policies-linux-appimage.json NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/distribution/policies.json 10 | cp src/open-in-default-browser/open-in-default-browser NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/ 11 | cp src/open-in-default-browser/open_in_default_browser-1.0.zip NEUTRON_INTERNAL_APP_NAME.AppImage/usr/lib/NEUTRON_INTERNAL_APP_NAME/ 12 | 13 | ARCH=arm_aarch64 appimagetool NEUTRON_INTERNAL_APP_NAME.AppImage/ 14 | -------------------------------------------------------------------------------- /src/scripts/build/download-firefox-source: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -d mozilla-unified ]; then 4 | mozbuild=~/.mozbuild 5 | mkdir mozilla-unified 6 | curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py -O 7 | python3 bootstrap.py --vcs=git --no-interactive --application-choice=browser_artifact_mode 8 | mkdir cinnabar 9 | cd cinnabar 10 | curl https://raw.githubusercontent.com/glandium/git-cinnabar/master/download.py -O download.py 11 | python download.py 12 | cd .. 13 | cd mozilla-unified 14 | PATH="$(realpath ../cinnabar):$PATH" git cinnabar fetch --tags 15 | git checkout $(git tag | grep -E "^FIREFOX_[0-9]*_[0-9]*(_[0-9]*)?_RELEASE" | sort -V | tail -n1) 16 | cd .. 17 | fi -------------------------------------------------------------------------------- /src/scripts/build/launch-app-linux: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -rf src/launch-app/build 4 | mkdir src/launch-app/build 5 | pushd src/launch-app/build 6 | CC=gcc CXX=g++ cmake .. -DAPPLICATION_NAME=\"NEUTRON_INTERNAL_APP_NAME\" -DSHOULD_OPEN_IN_DEFAULT_BROWSER=NEUTRON_OPEN_IN_DEFAULT_BROWSER -DSHOULD_RUN_IN_BACKGROUND=NEUTRON_SHOULD_RUN_IN_BACKGROUND 7 | make -j 8 | cp launch-app ../../launch-app.linux 9 | popd 10 | -------------------------------------------------------------------------------- /src/scripts/build/launch-app-linux-aarch64: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -rf src/launch-app/build 4 | mkdir src/launch-app/build 5 | pushd src/launch-app/build 6 | CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ cmake -DCMAKE_CXX_FLAGS="-fpermissive" -DCMAKE_SYSTEM_PROCESSOR=aarch64 .. -DBOOST_CONTEXT_ARCHITECTURE=arm64 -DBOOST_CONTEXT_ABI=aapcs -DBOOST_CONTEXT_ASM_SUFFIX=.S -DAPPLICATION_NAME=\"NEUTRON_INTERNAL_APP_NAME\" -DSHOULD_OPEN_IN_DEFAULT_BROWSER=NEUTRON_OPEN_IN_DEFAULT_BROWSER -DSHOULD_RUN_IN_BACKGROUND=NEUTRON_SHOULD_RUN_IN_BACKGROUND 7 | cp launch-app ../../launch-app.linux-aarch64 8 | popd 9 | -------------------------------------------------------------------------------- /src/scripts/build/launch-app-mac-arm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Build osxcross 4 | git clone https://github.com/tpoechtrager/osxcross.git --recurse-submodules 5 | cd osxcross 6 | wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz -O tarballs/MacOSX11.3.sdk.tar.xz 7 | UNATTENDED=1 ./build.sh 8 | export MACOSX_DEPLOYMENT_TARGET=10.15 9 | PATH="$(realpath target/bin):${PATH}" 10 | UNATTENDED=1 MACOSX_DEPLOYMENT_TARGET=11.3 osxcross-macports install boost181 11 | echo $(MACOSX_DEPLOYMENT_TARGET=11.3 osxcross-macports --ldflags boost181) 12 | boost_system_path="$(realpath target/macports/pkgs/opt/local/libexec/boost/1.81/lib/libboost_system-mt.dylib)" 13 | boost_thread_path="$(realpath target/macports/pkgs/opt/local/libexec/boost/1.81/lib/libboost_thread-mt.dylib)" 14 | cd .. 15 | 16 | rm -rf src/launch-app/build 17 | mkdir src/launch-app/build 18 | pushd src/launch-app/build 19 | arm64-apple-darwin20.4-cmake \ 20 | -DCMAKE_C_COMPILER=$(realpath ../../../osxcross/target/bin/oa64-clang) \ 21 | -DCMAKE_CXX_COMPILER=$(realpath ../../../osxcross/target/bin/oa64-clang++) \ 22 | -DCMAKE_SYSTEM_PROCESSOR=arm64 \ 23 | -DCMAKE_SIZEOF_VOID_P=8 \ 24 | -DCMAKE_SYSTEM_NAME=Darwin \ 25 | -DBOOST_SYSTEM_LIB="${boost_system_path}" \ 26 | -DBOOST_THREAD_LIB="${boost_thread_path}" \ 27 | -DMY_BOOST_INCLUDE_DIRS=$(realpath ../../../osxcross/target/macports/pkgs/opt/local/libexec/boost/1.81/include/) \ 28 | .. \ 29 | -DAPPLICATION_NAME=\"NEUTRON_INTERNAL_APP_NAME\" \ 30 | -DSHOULD_OPEN_IN_DEFAULT_BROWSER=NEUTRON_OPEN_IN_DEFAULT_BROWSER \ 31 | -DSHOULD_RUN_IN_BACKGROUND=NEUTRON_SHOULD_RUN_IN_BACKGROUND 32 | make -j 33 | cp launch-app ../../launch-app.mac-arm 34 | popd 35 | -------------------------------------------------------------------------------- /src/scripts/build/launch-app-mac-intel: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Build osxcross 4 | git clone https://github.com/tpoechtrager/osxcross.git --recurse-submodules 5 | cd osxcross 6 | wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz -O tarballs/MacOSX11.3.sdk.tar.xz 7 | export MACOSX_DEPLOYMENT_TARGET=10.15 8 | UNATTENDED=1 ./build.sh 9 | PATH="$(realpath target/bin):${PATH}" 10 | UNATTENDED=1 MACOSX_DEPLOYMENT_TARGET=11.3 osxcross-macports install boost181 11 | echo $(MACOSX_DEPLOYMENT_TARGET=11.3 osxcross-macports --ldflags boost181) 12 | boost_system_path="$(realpath target/macports/pkgs/opt/local/libexec/boost/1.81/lib/libboost_system-mt.dylib)" 13 | boost_thread_path="$(realpath target/macports/pkgs/opt/local/libexec/boost/1.81/lib/libboost_thread-mt.dylib)" 14 | cd .. 15 | 16 | rm -rf src/launch-app/build 17 | mkdir src/launch-app/build 18 | pushd src/launch-app/build 19 | x86_64-apple-darwin20.4-cmake \ 20 | -DCMAKE_C_COMPILER=$(realpath ../../../osxcross/target/bin/o64-clang) \ 21 | -DCMAKE_CXX_COMPILER=$(realpath ../../../osxcross/target/bin/o64-clang++) \ 22 | -DCMAKE_SYSTEM_PROCESSOR=x86_64 \ 23 | -DCMAKE_SIZEOF_VOID_P=8 \ 24 | -DCMAKE_SYSTEM_NAME=Darwin \ 25 | -DBOOST_SYSTEM_LIB="${boost_system_path}" \ 26 | -DBOOST_THREAD_LIB="${boost_thread_path}" \ 27 | -DMY_BOOST_INCLUDE_DIRS=$(realpath ../../../osxcross/target/macports/pkgs/opt/local/libexec/boost/1.81/include/) \ 28 | .. \ 29 | -DAPPLICATION_NAME=\"NEUTRON_INTERNAL_APP_NAME\" \ 30 | -DSHOULD_OPEN_IN_DEFAULT_BROWSER=NEUTRON_OPEN_IN_DEFAULT_BROWSER \ 31 | -DSHOULD_RUN_IN_BACKGROUND=NEUTRON_SHOULD_RUN_IN_BACKGROUND 32 | make -j 33 | cp launch-app ../../launch-app.mac-intel 34 | popd 35 | -------------------------------------------------------------------------------- /src/scripts/build/launch-app-windows: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pushd src/windows 4 | x86_64-w64-mingw32-windres app.rc -O coff -o app.res 5 | popd 6 | 7 | rm -rf src/launch-app/build 8 | mkdir src/launch-app/build 9 | pushd src/launch-app/build 10 | cmake \ 11 | -DCMAKE_SYSTEM_NAME=Windows \ 12 | -DCMAKE_CXX_FLAGS="-Wno-cast-function-type -static -static-libgcc -static-libstdc++ -mwindows" \ 13 | -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \ 14 | -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \ 15 | .. \ 16 | -DAPPLICATION_NAME=\"NEUTRON_INTERNAL_APP_NAME.exe\" \ 17 | -DSHOULD_OPEN_IN_DEFAULT_BROWSER=NEUTRON_OPEN_IN_DEFAULT_BROWSER \ 18 | -DSHOULD_RUN_IN_BACKGROUND=NEUTRON_SHOULD_RUN_IN_BACKGROUND \ 19 | -DRES_PATH="../../windows/app.res" \ 20 | -D_WINDOWS= \ 21 | -DWIN32= \ 22 | -DBOOST_IOSTREAMS_ENABLE_ZSTD=false 23 | 24 | make -j 25 | cp launch-app.exe ../../launch-app.windows 26 | popd -------------------------------------------------------------------------------- /src/scripts/build/linux: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mozbuild=~/.mozbuild 4 | export PATH="$PATH:$mozbuild/git-cinnabar" 5 | rootDir=$PWD 6 | 7 | cd mozilla-unified 8 | 9 | cp -r ../src/changed/* . 10 | cp ../src/mozconfig.linux mozconfig 11 | patch -N -p1 < ../src/mozilla_dirsFromLibreWolf.patch 12 | 13 | ./mach configure 14 | ./mach build 15 | ./mach package 16 | 17 | cd .. 18 | 19 | rm -r NEUTRON_INTERNAL_APP_NAME-linux-x86_64 20 | mkdir NEUTRON_INTERNAL_APP_NAME-linux-x86_64 21 | tar --strip-components=1 -xvf mozilla-unified/obj-x86_64-pc-linux-gnu/dist/*.tar.bz2 -C NEUTRON_INTERNAL_APP_NAME-linux-x86_64/ 22 | cp -r src/distribution/ NEUTRON_INTERNAL_APP_NAME-linux-x86_64/ 23 | mv NEUTRON_INTERNAL_APP_NAME-linux-x86_64/distribution/policies-linux.json NEUTRON_INTERNAL_APP_NAME-linux-x86_64/distribution/policies.json 24 | cp src/open-in-default-browser/open-in-default-browser NEUTRON_INTERNAL_APP_NAME-linux-x86_64/open-in-default-browser 25 | cp src/launch-app.linux NEUTRON_INTERNAL_APP_NAME-linux-x86_64/launch-app 26 | 27 | if ((NEUTRON_OPEN_IN_DEFAULT_BROWSER)); then 28 | mkdir NEUTRON_INTERNAL_APP_NAME-linux-x86_64/distribution/extensions 29 | cp src/open-in-default-browser/open_in_default_browser-1.0.zip NEUTRON_INTERNAL_APP_NAME-linux-x86_64/distribution/extensions/open-in-default-browser.xpi 30 | fi 31 | 32 | tar -cjf NEUTRON_INTERNAL_APP_NAME-linux-x86_64.tar.bz2 NEUTRON_INTERNAL_APP_NAME-linux-x86_64 33 | -------------------------------------------------------------------------------- /src/scripts/build/linux-aarch64: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mozbuild=~/.mozbuild 4 | export PATH="$PATH:$mozbuild/git-cinnabar" 5 | rootDir=$PWD 6 | 7 | cd mozilla-unified 8 | 9 | cp -r ../src/changed/* . 10 | cp ../src/mozconfig.linux-aarch64 mozconfig 11 | patch -N -p1 < ../src/mozilla_dirsFromLibreWolf.patch 12 | 13 | ./mach configure 14 | ./mach build 15 | ./mach package 16 | 17 | cd .. 18 | 19 | rm -r NEUTRON_INTERNAL_APP_NAME-linux-aarch64 20 | mkdir NEUTRON_INTERNAL_APP_NAME-linux-aarch64 21 | tar --strip-components=1 -xvf mozilla-unified/obj-aarch64-unknown-linux-gnu/dist/*.tar.bz2 -C NEUTRON_INTERNAL_APP_NAME-linux-aarch64/ 22 | cp -r src/distribution/ NEUTRON_INTERNAL_APP_NAME-linux-aarch64/ 23 | mv NEUTRON_INTERNAL_APP_NAME-linux-aarch64/distribution/policies-linux.json NEUTRON_INTERNAL_APP_NAME-linux-aarch64/distribution/policies.json 24 | cp src/open-in-default-browser/open-in-default-browser NEUTRON_INTERNAL_APP_NAME-linux-aarch64/open-in-default-browser 25 | cp src/launch-app.linux NEUTRON_INTERNAL_APP_NAME-linux-aarch64/launch-app 26 | if ((NEUTRON_OPEN_IN_DEFAULT_BROWSER)); then 27 | mkdir NEUTRON_INTERNAL_APP_NAME-linux-aarch64/distribution/extensions 28 | cp src/open-in-default-browser/open_in_default_browser-1.0.zip NEUTRON_INTERNAL_APP_NAME-linux-aarch64/distribution/extensions/open-in-default-browser.xpi 29 | fi 30 | tar -cjf NEUTRON_INTERNAL_APP_NAME-linux-aarch64.tar.bz2 NEUTRON_INTERNAL_APP_NAME-linux-aarch64 31 | -------------------------------------------------------------------------------- /src/scripts/build/mac-arm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mozbuild=~/.mozbuild 4 | export PATH="$PATH:$mozbuild/git-cinnabar" 5 | rootDir=$PWD 6 | 7 | rustup target add aarch64-apple-darwin 8 | 9 | cd mozilla-unified 10 | 11 | cp -r ../src/changed/* . 12 | cp ../src/mozconfig.mac-arm mozconfig 13 | patch -N -p1 < ../src/mozilla_dirsFromLibreWolf.patch 14 | patch -N -p1 < ../src/mac/close-on-window-closed.patch 15 | 16 | ./mach configure 17 | ./mach build 18 | ./mach package 19 | 20 | cd .. 21 | 22 | rm -rf NEUTRON_INTERNAL_APP_NAME-darwin-aarch64 23 | mkdir NEUTRON_INTERNAL_APP_NAME-darwin-aarch64 24 | 25 | cp -r mozilla-unified/obj-aarch64-apple-darwin/dist/NEUTRON_INTERNAL_APP_NAME/*.app/* NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/ 26 | 27 | cp -r src/distribution/ NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/Resources/ 28 | mv NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/Resources/distribution/policies-linux.json NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/Resources/distribution/policies.json 29 | 30 | cp src/open-in-default-browser/open-in-default-browser-mac NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/Resources/open-in-default-browser 31 | cp src/open-in-default-browser/open-in-default-browser-mac NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/MacOS/open-in-default-browser 32 | 33 | cp src/launch-app.mac-arm NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/Resources/launch-app 34 | cp src/launch-app.mac-arm NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/MacOS/launch-app 35 | 36 | cp src/changed/browser/branding/NEUTRON_INTERNAL_APP_NAME/firefox.icns NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/Resources/firefox.icns 37 | 38 | if ((NEUTRON_OPEN_IN_DEFAULT_BROWSER)); then 39 | mkdir NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/Resources/distribution/extensions 40 | cp src/open-in-default-browser/open_in_default_browser-1.0.zip NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/Resources/distribution/extensions/open-in-default-browser.xpi 41 | fi 42 | 43 | cp -f src/mac/Info-aarch64.plist NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents/Info.plist 44 | 45 | mkdir "NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/NEUTRON_APP_NAME.app" 46 | mv NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/Contents "NEUTRON_INTERNAL_APP_NAME-darwin-aarch64/NEUTRON_APP_NAME.app/" 47 | 48 | rm NEUTRON_INTERNAL_APP_NAME-darwin-aarch64.dmg 49 | mozilla-unified/mach python -m mozbuild.action.make_dmg NEUTRON_INTERNAL_APP_NAME-darwin-aarch64 NEUTRON_INTERNAL_APP_NAME-darwin-aarch64.dmg --volume-name="NEUTRON_APP_NAME" --dsstore=src/branding-template/dsstore 50 | -------------------------------------------------------------------------------- /src/scripts/build/mac-intel: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mozbuild=~/.mozbuild 4 | export PATH="$PATH:$mozbuild/git-cinnabar" 5 | rootDir=$PWD 6 | 7 | rustup target add x86_64-apple-darwin 8 | 9 | cd mozilla-unified 10 | 11 | cp -r ../src/changed/* . 12 | cp ../src/mozconfig.mac-intel mozconfig 13 | patch -N -p1 < ../src/mozilla_dirsFromLibreWolf.patch 14 | patch -N -p1 < ../src/mac/close-on-window-closed.patch 15 | 16 | ./mach configure 17 | ./mach build 18 | ./mach package 19 | 20 | cd .. 21 | 22 | rm -rf NEUTRON_INTERNAL_APP_NAME-darwin-x86_64 23 | mkdir NEUTRON_INTERNAL_APP_NAME-darwin-x86_64 24 | 25 | cp -r mozilla-unified/obj-x86_64-apple-darwin/dist/NEUTRON_INTERNAL_APP_NAME/*.app/* NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/ 26 | 27 | cp -r src/distribution/ NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/Resources/ 28 | mv NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/Resources/distribution/policies-linux.json NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/Resources/distribution/policies.json 29 | 30 | cp src/open-in-default-browser/open-in-default-browser-mac NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/Resources/open-in-default-browser 31 | cp src/open-in-default-browser/open-in-default-browser-mac NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/MacOS/open-in-default-browser 32 | 33 | cp src/launch-app.mac-intel NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/Resources/launch-app 34 | cp src/launch-app.mac-intel NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/MacOS/launch-app 35 | 36 | cp src/changed/browser/branding/NEUTRON_INTERNAL_APP_NAME/firefox.icns NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/Resources/firefox.icns 37 | 38 | if ((NEUTRON_OPEN_IN_DEFAULT_BROWSER)); then 39 | mkdir NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/Resources/distribution/extensions 40 | cp src/open-in-default-browser/open_in_default_browser-1.0.zip NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/Resources/distribution/extensions/open-in-default-browser.xpi 41 | fi 42 | 43 | cp -f src/mac/Info-x86_64.plist NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents/Info.plist 44 | 45 | mkdir "NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/NEUTRON_APP_NAME.app" 46 | mv NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/Contents "NEUTRON_INTERNAL_APP_NAME-darwin-x86_64/NEUTRON_APP_NAME.app/" 47 | 48 | rm NEUTRON_INTERNAL_APP_NAME-darwin-x86_64.dmg 49 | mozilla-unified/mach python -m mozbuild.action.make_dmg NEUTRON_INTERNAL_APP_NAME-darwin-x86_64 NEUTRON_INTERNAL_APP_NAME-darwin-x86_64.dmg --volume-name="NEUTRON_APP_NAME" --dsstore=src/branding-template/dsstore 50 | -------------------------------------------------------------------------------- /src/scripts/build/open-in-default-browser: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # pushd src/open-in-default-browser 4 | # make 5 | # popd 6 | 7 | cp -r src/open-in-default-browser/open-in-default-browser-ext mozilla-unified/browser/extensions/open-in-default-browser 8 | 9 | pushd mozilla-unified 10 | patch -N -p1 < ../src/open-in-default-browser/builtin-open-in-default-browser.patch 11 | popd -------------------------------------------------------------------------------- /src/scripts/build/windows: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export mozbuild=~/.mozbuild 4 | export PATH="$PATH:$mozbuild/git-cinnabar" 5 | appDir=$PWD 6 | 7 | mkdir -p $mozbuild 8 | 9 | cd mozilla-unified 10 | 11 | cp -r ../src/changed/* . 12 | cp ../src/mozconfig.windows mozconfig 13 | patch -N -p1 < ../src/mozilla_dirsFromLibreWolf.patch 14 | 15 | # Add cross compile target 16 | rustup target add x86_64-pc-windows-msvc 17 | 18 | # Install toolchains 19 | if [ $# -eq 0 ]; then 20 | cd $mozbuild 21 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-binutils 22 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-cbindgen 23 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-clang 24 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-dump_syms 25 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-liblowercase 26 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-nasm 27 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-node 28 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-rust-cross 29 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-winchecksec 30 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-wine 31 | $appDir/mozilla-unified/mach artifact toolchain --from-build nsis 32 | $appDir/mozilla-unified/mach artifact toolchain --from-build sysroot-x86_64-linux-gnu 33 | $appDir/mozilla-unified/mach artifact toolchain --from-build windows-rs 34 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-mingw-fxc2-x86 35 | cd $appDir/mozilla-unified 36 | else 37 | if [ "$1" -ne "--no-download-toolchains" ]; then 38 | cd $mozbuild 39 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-binutils 40 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-cbindgen 41 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-clang 42 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-dump_syms 43 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-liblowercase 44 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-nasm 45 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-node 46 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-rust-cross 47 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-winchecksec 48 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-wine 49 | $appDir/mozilla-unified/mach artifact toolchain --from-build nsis 50 | $appDir/mozilla-unified/mach artifact toolchain --from-build sysroot-x86_64-linux-gnu 51 | $appDir/mozilla-unified/mach artifact toolchain --from-build windows-rs 52 | $appDir/mozilla-unified/mach artifact toolchain --from-build linux64-mingw-fxc2-x86 53 | cd $appDir/mozilla-unified 54 | fi 55 | fi 56 | 57 | 58 | # Get windows sdk if needed 59 | if [ ! -d $mozbuild/win-cross ]; then 60 | # Generate yaml that contains things to download from Visual Studio packages 61 | ./mach python --virtualenv build build/vs/generate_yaml.py \ 62 | --major \ 63 | 17 \ 64 | Microsoft.VisualCpp.CRT.Headers \ 65 | Microsoft.VisualCpp.CRT.Redist.ARM64 \ 66 | Microsoft.VisualCpp.CRT.Redist.X64 \ 67 | Microsoft.VisualCpp.CRT.Redist.X86 \ 68 | Microsoft.VisualCpp.CRT.x64.Desktop \ 69 | Microsoft.VisualCpp.CRT.x64.Store \ 70 | Microsoft.VisualCpp.CRT.x86.Desktop \ 71 | Microsoft.VisualCpp.CRT.x86.Store \ 72 | Microsoft.VisualCpp.DIA.SDK \ 73 | Microsoft.VisualCpp.Tools.HostX64.TargetARM64 \ 74 | Microsoft.VisualCpp.Tools.HostX64.TargetX64 \ 75 | Microsoft.VisualCpp.Tools.HostX64.TargetX86 \ 76 | Microsoft.VisualStudio.Component.VC.ATL.ARM64 \ 77 | Microsoft.VisualStudio.Component.VC.ATL \ 78 | Microsoft.VisualStudio.Component.VC.ATLMFC \ 79 | Microsoft.VisualStudio.Component.VC.MFC.ARM64 \ 80 | Win10SDK_10.0.19041 \ 81 | -o \ 82 | build/vs/vs2022.yaml 83 | 84 | ./mach --no-interactive python --virtualenv build build/vs/pack_vs.py build/vs/vs2022.yaml -o $mozbuild/vs.tar.zst 85 | mkdir -p $mozbuild/win-cross && cd $mozbuild/win-cross && rm -rf vs && tar xf ../vs.tar.zst 86 | cd $appDir/mozilla-unified 87 | fi 88 | 89 | cp $mozbuild/win-cross/vs/Windows Kits/10/bin/10.0.19041.0/x64/fxc.exe $mozbuild/win-cross/vs/Windows Kits/10/bin/10.0.19041.0/x64/fxc2.exe 90 | 91 | ls $mozbuild 92 | ls $mozbuild/wine/bin 93 | 94 | patch -N -p1 < ../src/windows/fxc.patch 95 | 96 | ./mach configure 97 | ./mach build 98 | ./mach package 99 | 100 | # Change the setup exe 101 | mkdir $appDir/work 102 | cp obj-x86_64-pc-mingw32/dist/install/sea/*.exe $appDir/work/ffSetup-win64.exe 103 | cd $appDir/work 104 | 7z x ffSetup-win64.exe 105 | ls 106 | mv core NEUTRON_INTERNAL_APP_NAME 107 | rm setup.exe 108 | cd NEUTRON_INTERNAL_APP_NAME 109 | cd .. 110 | cp ../src/windows/NEUTRON_INTERNAL_APP_NAME.ico NEUTRON_INTERNAL_APP_NAME/ 111 | mkdir NEUTRON_INTERNAL_APP_NAME/distribution 112 | cp ../src/distribution/policies-windows.json NEUTRON_INTERNAL_APP_NAME/distribution/policies.json 113 | cp ../src/open-in-default-browser/open-in-default-browser.bat NEUTRON_INTERNAL_APP_NAME/ 114 | 115 | if ((NEUTRON_OPEN_IN_DEFAULT_BROWSER)); then 116 | mkdir NEUTRON_INTERNAL_APP_NAME/distribution/extensions 117 | cp ../src/open-in-default-browser/open_in_default_browser-1.0.zip NEUTRON_INTERNAL_APP_NAME/distribution/extensions/open-in-default-browser.xpi 118 | fi 119 | 120 | cp ../src/launch-app.windows NEUTRON_INTERNAL_APP_NAME/launch-NEUTRON_INTERNAL_APP_NAME.exe 121 | 122 | # Based on librewolf mk.py 123 | mkdir x86-ansi 124 | wget -q -O ./x86-ansi/nsProcess.dll https://sanghai.org/files/nsProcess.dll 125 | wget -q -O ./vc_redist.x64.exe https://aka.ms/vs/17/release/vc_redist.x64.exe 126 | cp ../src/windows/setup.nsi . 127 | cp ../src/windows/NEUTRON_INTERNAL_APP_NAME.ico . 128 | cp ../src/windows/banner.bmp . 129 | DISPLAY=:0 $mozbuild/wine/bin/wine $mozbuild/nsis/makensis.exe -V1 setup.nsi 130 | # Setup filename will be NEUTRON_INTERNAL_APP_NAMESetup-win64.exe 131 | -------------------------------------------------------------------------------- /src/windows/app.rc: -------------------------------------------------------------------------------- 1 | id ICON "NEUTRON_INTERNAL_APP_NAME.ico" -------------------------------------------------------------------------------- /src/windows/fxc.patch: -------------------------------------------------------------------------------- 1 | --- mozilla-unified/gfx/layers/d3d11/genshaders.py.old 2023-10-07 15:37:52.084397991 -0700 2 | +++ mozilla-unified/gfx/layers/d3d11/genshaders.py 2023-10-07 16:24:42.124594895 -0700 3 | @@ -100,7 +100,7 @@ 4 | proc_stdout = subprocess.check_output(argv) 5 | proc_stdout = decode_console_text(sys.stdout, proc_stdout) 6 | deps = find_dependencies(proc_stdout) 7 | - assert "fxc2" in fxc_location or len(deps) > 0 8 | + assert "fxc" in fxc_location or len(deps) > 0 9 | 10 | with open(temp_filename, "r") as temp_fp: 11 | output_fp.write(temp_fp.read()) 12 | -------------------------------------------------------------------------------- /src/windows/setup.nsi: -------------------------------------------------------------------------------- 1 | # Taken from LibreWolf: https://gitlab.com/librewolf-community/browser/windows/-/blob/master/assets/setup.nsi 2 | 3 | !include "MUI2.nsh" 4 | !include "LogicLib.nsh" 5 | !addplugindir . 6 | !addplugindir x86-ansi 7 | 8 | !define APPNAME "NEUTRON_APP_NAME" 9 | !define PROGNAME "NEUTRON_INTERNAL_APP_NAME" 10 | !define EXECUTABLE "launch-${PROGNAME}.exe" 11 | !define PROG_VERSION "NEUTRON_APP_VERSION" 12 | !define COMPANYNAME "NEUTRON_APP_NAME" 13 | !define ESTIMATED_SIZE 190000 14 | !define MUI_ICON "NEUTRON_INTERNAL_APP_NAME.ico" 15 | !define MUI_WELCOMEFINISHPAGE_BITMAP "banner.bmp" 16 | 17 | Name "${APPNAME}" 18 | OutFile "appSetup-win64.exe" 19 | InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" 20 | InstallDir $PROGRAMFILES64\${APPNAME} 21 | RequestExecutionLevel admin 22 | 23 | # Pages 24 | 25 | !define MUI_ABORTWARNING 26 | 27 | !define MUI_WELCOMEPAGE_TITLE "Welcome to the NEUTRON_APP_NAME Setup" 28 | !define MUI_WELCOMEPAGE_TEXT "This setup will guide you through the installation of NEUTRON_APP_NAME.$\r$\n$\r$\n\ 29 | If you don't have it installed already, this will also install the latest Visual C++ Redistributable.$\r$\n$\r$\n\ 30 | Click Next to continue." 31 | !insertmacro MUI_PAGE_WELCOME 32 | !insertmacro MUI_PAGE_DIRECTORY 33 | !insertmacro MUI_PAGE_INSTFILES 34 | !insertmacro MUI_PAGE_FINISH 35 | 36 | !insertmacro MUI_UNPAGE_CONFIRM 37 | !insertmacro MUI_UNPAGE_INSTFILES 38 | 39 | !insertmacro MUI_LANGUAGE "English" 40 | 41 | Section 42 | 43 | # Make sure app is closed before the installation 44 | nsProcess::_FindProcess "${EXECUTABLE}" 45 | Pop $R0 46 | ${If} $R0 = 0 47 | IfSilent 0 +4 48 | DetailPrint "${APPNAME} is still running, aborting because of silent install." 49 | SetErrorlevel 2 50 | Abort 51 | 52 | DetailPrint "${APPNAME} is still running" 53 | MessageBox MB_OKCANCEL "NEUTRON_APP_NAME is still running and has to be closed for the setup to continue." IDOK continue IDCANCEL break 54 | break: 55 | SetErrorlevel 1 56 | Abort 57 | continue: 58 | DetailPrint "Closing ${APPNAME} gracefully..." 59 | nsProcess::_KillProcess "${EXECUTABLE}" 60 | Pop $R0 61 | Sleep 2000 62 | nsProcess::_FindProcess "${EXECUTABLE}" 63 | Pop $R0 64 | ${If} $R0 = 0 65 | DetailPrint "Failed to close ${APPNAME}, killing it..." 66 | nsProcess::_KillProcess "${EXECUTABLE}" 67 | nsProcess::_KillProcess "${EXECUTABLE}" 68 | Sleep 2000 69 | nsProcess::_FindProcess "${EXECUTABLE}" 70 | nsProcess::_FindProcess "${EXECUTABLE}" 71 | Pop $R0 72 | ${EndIf} 73 | ${EndIf} 74 | 75 | # Install Visual C++ Redistributable (only if not silent) 76 | IfSilent +4 0 77 | InitPluginsDir 78 | File /oname=$PLUGINSDIR\vc_redist.x64.exe vc_redist.x64.exe 79 | ExecWait "$PLUGINSDIR\vc_redist.x64.exe /install /quiet /norestart" 80 | 81 | # Copy files 82 | SetOutPath $INSTDIR 83 | File /r NEUTRON_INTERNAL_APP_NAME\*.* 84 | 85 | # Start Menu 86 | createDirectory "$SMPROGRAMS\${COMPANYNAME}" 87 | createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\launch-${PROGNAME}.exe" "" "$INSTDIR\${MUI_ICON}" 88 | createShortCut "$SMPROGRAMS\${COMPANYNAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "" 89 | 90 | # Uninstaller 91 | writeUninstaller "$INSTDIR\uninstall.exe" 92 | 93 | # Registry information for add/remove programs 94 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" "${APPNAME}" 95 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" 96 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" 97 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" "$\"$INSTDIR$\"" 98 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$\"$INSTDIR\${MUI_ICON}$\"" 99 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "Publisher" "${COMPANYNAME}" 100 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayVersion" "${PROG_VERSION}" 101 | # There is no option for modifying or repairing the install 102 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoModify" 1 103 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoRepair" 1 104 | # Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size 105 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "EstimatedSize" ${ESTIMATED_SIZE} 106 | 107 | SectionEnd 108 | 109 | 110 | # Uninstaller 111 | section "Uninstall" 112 | 113 | # Kill app if it is still running 114 | nsProcess::_FindProcess "${EXECUTABLE}" 115 | Pop $R0 116 | ${If} $R0 = 0 117 | DetailPrint "${APPNAME} is still running, killing it..." 118 | nsProcess::_KillProcess "${EXECUTABLE}" 119 | Sleep 2000 120 | ${EndIf} 121 | 122 | # Remove Start Menu launcher 123 | delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" 124 | delete "$SMPROGRAMS\${COMPANYNAME}\Uninstall.lnk" 125 | # Try to remove the Start Menu folder - this will only happen if it is empty 126 | rmDir "$SMPROGRAMS\${COMPANYNAME}" 127 | 128 | # Remove files 129 | rmDir /r $INSTDIR 130 | 131 | # Remove uninstaller information from the registry 132 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" 133 | 134 | sectionEnd 135 | -------------------------------------------------------------------------------- /test/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName": "Neutron Test App", 3 | "internalAppName": "neutron-test-app", 4 | "url": "https://example.com", 5 | "logoSvgFilePath": "../test/test.svg", 6 | "platforms": [ 7 | "linux", 8 | "appimage", 9 | "linux-aarch64", 10 | "appimage-aarch64", 11 | "windows", 12 | "mac-arm", 13 | "mac-intel" 14 | ], 15 | "extensionURLs": [ 16 | "NEUTRON_OPEN_IN_DEFAULT_BROWSER_EXTENSION_LOCATION" 17 | ], 18 | "version": "0.5.0", 19 | "projectURL": "https://github.com/gamingdoom/neutron", 20 | "projectHelpURL": "https://github.com/gamingdoom/neutron/issues", 21 | "openInDefaultBrowser": true, 22 | "openInDefaultBrowserRegex": "http[s]?://example.com", 23 | "runInBackground": true 24 | } 25 | -------------------------------------------------------------------------------- /test/test.svg: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | SVG 8 | 9 | 10 | --------------------------------------------------------------------------------