Skip to content
Commits on Source (105)
---
image: python:$PYTHON_VERSION
build:
before_script:
- apt-get update
- apt-get install -y libgirepository1.0-dev ninja-build
- pip install meson pygobject
script:
- meson --prefix=/usr builddir
- cd builddir
- meson install
parallel:
matrix:
- PYTHON_VERSION:
- '3.8'
- '3.9'
- '3.10'
[FORMAT]
max-line-length=120
# GNOME Shell integration for Chrome build script
cmake_minimum_required (VERSION 2.8)
project (chrome-gnome-shell NONE)
# Suppress warning
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
set(CMAKE_SIZEOF_VOID_P 8)
endif(NOT DEFINED CMAKE_SIZEOF_VOID_P)
# Variables
set(PROJECT_VERSION "10.1")
set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION})
set(ARCHIVE_FULL_NAME ${ARCHIVE_NAME}.tar.xz)
set(ARCHIVE_DEB_NAME ${CMAKE_PROJECT_NAME}_${PROJECT_VERSION}.orig.tar.xz)
set(DEB_DIR ${CMAKE_CURRENT_BINARY_DIR}/deb)
set(EXTENSION_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/extension)
set(EXTENSION_BUILD_DIR ${CMAKE_BINARY_DIR}/extension)
set(CHROME_BUILD_DIR ${EXTENSION_BUILD_DIR}/chrome)
set(OPERA_BUILD_DIR ${EXTENSION_BUILD_DIR}/opera)
set(FIREFOX_BUILD_DIR ${EXTENSION_BUILD_DIR}/firefox)
# Options
option(BUILD_EXTENSION "Build extension zip package" TRUE)
option(BUILD_CONNECTOR "Build native messaging host" TRUE)
option(BUILD_SOURCE_PACKAGE "Build source package" FALSE)
option(BUILD_DEB "Build debian package" FALSE)
option(BUILD_MESSAGES "Update translation strings" FALSE)
option(USE_DEBIAN_LAYOUT "Use --install-layout=deb distutils parameter" FALSE)
# Default extension key for Chrome web store
if(NOT DEFINED CHROME_EXTENSION_KEY)
set(CHROME_EXTENSION_KEY "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlig8TAPPQZinMkJnptC0ldizx6fG9jSjZDJ9c8GuLcXeGRH+NMlQuPC9bR5IQlT7+4VY/1tm1+IZ4xvITx1wXCNTR+KXzZv3VNc2D+logehK7oIRTRj0fLhixrx4NLSNK7L7HgV2xcIoW6QV0jOdFcTPL0mWXodXSzZePrvXuflF7qpwNxLzYVi04Vh3xu2oR2Pc9SwfZ4SNbyCaunH/p8n5AYmDuogI2Ah++RZw0ctnqn7mmHrGXteBu/vkpcHZu3B3eW9PFSrv69rRs8duybYR9C91hJm6yzRqZqIpindIU3k2HnNWeCFWkRVpZPhaNVoxcBUO7wWUUwdIflW2JwIDAQAB")
endif(NOT DEFINED CHROME_EXTENSION_KEY)
# Default extension key for Opera addons
if(NOT DEFINED OPERA_EXTENSION_KEY)
set(OPERA_EXTENSION_KEY "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1QBzvBFxSTBP1Z3u+B3GnxOhZiT/LLGJ9R3Mu3R5ap1YgvbHNqSj0CmrWE+MvJUYA+AxHSRP6ctKfPBZl/kdGYGLPgvagGBEEbutCerj9www7T2LAsFNc5gIgDXaU0P74Yik8MjLZIXOC3Q91Kien5Jbtit382HNVHl2nRbhgGZ9LZ+6UJnzSseW9NHw0/XRRnT0kv0Ih7lgC55xWfP7guam1uaT5DPxC7W5cy9V1z7mljBf50OxgnbEmf7Xvfz4QpQfDyQWE5hqKlBuPc8W/8bvYmWN+FDBqhls/FCml3icAElNMBg0YryFEDzu6xCTzgHqDKYu5SN49u+m6tyamQIDAQAB")
endif(NOT DEFINED OPERA_EXTENSION_KEY)
# Debian variables
if(NOT DEFINED DEBIAN_VERSION)
set(DEBIAN_VERSION "0ubuntu1")
endif(NOT DEFINED DEBIAN_VERSION)
if(NOT DEFINED DEBIAN_DISTRO)
set(DEBIAN_DISTRO "trusty")
endif(NOT DEFINED DEBIAN_DISTRO)
macro(find_program_ex)
string(TOUPPER ${ARGV0} _PROGRAM_UPPER)
set(_NAMES ${ARGV})
math(EXPR _NAMES_LAST_INDEX "${ARGC}-1")
list(GET _NAMES ${_NAMES_LAST_INDEX} _MESSAGE_STATUS)
list(REMOVE_AT _NAMES ${_NAMES_LAST_INDEX})
find_program(${_PROGRAM_UPPER}_EXECUTABLE NAMES ${_NAMES})
if(${_PROGRAM_UPPER}_EXECUTABLE)
message(STATUS "Found ${ARGV0}: ${${_PROGRAM_UPPER}_EXECUTABLE}")
set(${_PROGRAM_UPPER}_FOUND TRUE)
else(${_PROGRAM_UPPER}_EXECUTABLE)
message(${_MESSAGE_STATUS} "Could NOT find ${ARGV0}.")
endif(${_PROGRAM_UPPER}_EXECUTABLE)
endmacro(find_program_ex)
include(GNUInstallDirs)
# Options validating
if(NOT BUILD_EXTENSION AND NOT BUILD_CONNECTOR AND NOT BUILD_MESSAGES)
message(FATAL_ERROR "No build options selected")
endif(NOT BUILD_EXTENSION AND NOT BUILD_CONNECTOR AND NOT BUILD_MESSAGES)
if(BUILD_DEB AND NOT BUILD_SOURCE_PACKAGE)
message(STATUS "Building of debian package enabled. Turning on building source package.")
set(BUILD_SOURCE_PACKAGE TRUE)
endif(BUILD_DEB AND NOT BUILD_SOURCE_PACKAGE)
if(BUILD_SOURCE_PACKAGE AND NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/)
message(FATAL_ERROR "Unable to build source package outside of git repository.")
endif(BUILD_SOURCE_PACKAGE AND NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/)
if(BUILD_MESSAGES AND NOT DEFINED GETTEXT_REPORT_EMAIL)
message(FATAL_ERROR "GETTEXT_REPORT_EMAIL must be specified to generate po template.")
endif(BUILD_MESSAGES AND NOT DEFINED GETTEXT_REPORT_EMAIL)
if(BUILD_EXTENSION OR BUILD_CONNECTOR)
find_program_ex(base64 gbase64 FATAL_ERROR)
find_program_ex(sha256sum gsha256sum FATAL_ERROR)
find_program_ex(head ghead FATAL_ERROR)
find_program_ex(tr gtr FATAL_ERROR)
find_program_ex(jq FATAL_ERROR)
# https://github.com/adobe/chromium/blob/master/chrome/common/extensions/extension.cc#L696
# http://stackoverflow.com/questions/23873623/obtaining-chrome-extension-id-for-development
execute_process(COMMAND echo "${CHROME_EXTENSION_KEY}"
COMMAND ${BASE64_EXECUTABLE} -d
COMMAND ${SHA256SUM_EXECUTABLE}
COMMAND ${HEAD_EXECUTABLE} -c32
COMMAND ${TR_EXECUTABLE} 0-9a-f a-p
OUTPUT_VARIABLE CHROME_EXTENSION_ID)
message(STATUS "Calculated Chrome extension id: ${CHROME_EXTENSION_ID}")
execute_process(COMMAND echo "${OPERA_EXTENSION_KEY}"
COMMAND ${BASE64_EXECUTABLE} -d
COMMAND ${SHA256SUM_EXECUTABLE}
COMMAND ${HEAD_EXECUTABLE} -c32
COMMAND ${TR_EXECUTABLE} 0-9a-f a-p
OUTPUT_VARIABLE OPERA_EXTENSION_ID)
message(STATUS "Calculated Opera extension id: ${OPERA_EXTENSION_ID}")
endif(BUILD_EXTENSION OR BUILD_CONNECTOR)
# Options handling
if(BUILD_EXTENSION)
find_program_ex(7z FATAL_ERROR)
file(COPY "${EXTENSION_SOURCES}/" DESTINATION "${CHROME_BUILD_DIR}"
PATTERN "manifest*.json" EXCLUDE)
file(COPY "${EXTENSION_SOURCES}/" DESTINATION "${OPERA_BUILD_DIR}"
PATTERN "manifest*.json" EXCLUDE)
file(COPY "${EXTENSION_SOURCES}/" DESTINATION "${FIREFOX_BUILD_DIR}"
PATTERN "manifest*.json" EXCLUDE)
set(PUBLIC_KEY ${CHROME_EXTENSION_KEY})
configure_file("${EXTENSION_SOURCES}/manifest.json" "${CHROME_BUILD_DIR}/")
set(PUBLIC_KEY ${OPERA_EXTENSION_KEY})
configure_file("${EXTENSION_SOURCES}/manifest.json" "${OPERA_BUILD_DIR}/")
unset(PUBLIC_KEY)
add_custom_target(chrome-extension ALL
COMMAND "${7Z_EXECUTABLE}" a -tzip "${CMAKE_BINARY_DIR}/extension-chrome.zip" ./
WORKING_DIRECTORY "${CHROME_BUILD_DIR}")
add_custom_target(opera-extension ALL
COMMAND "${7Z_EXECUTABLE}" a -tzip "${CMAKE_BINARY_DIR}/extension-opera.zip" ./
WORKING_DIRECTORY "${OPERA_BUILD_DIR}")
add_custom_target(firefox-extension ALL
COMMAND "${JQ_EXECUTABLE}" -s "'add|del(.key)'"
'${EXTENSION_SOURCES}/manifest.json' '${EXTENSION_SOURCES}/manifest.firefox.json'
> "${FIREFOX_BUILD_DIR}/manifest.json"
COMMAND "${7Z_EXECUTABLE}" a -tzip "${CMAKE_BINARY_DIR}/extension-firefox.zip" ./
WORKING_DIRECTORY "${FIREFOX_BUILD_DIR}")
endif(BUILD_EXTENSION)
if(BUILD_CONNECTOR)
find_package(PythonInterp REQUIRED)
set(CONNECTOR_SETUP "${CMAKE_CURRENT_SOURCE_DIR}/connector/setup.py")
add_custom_target(build-connector ALL
COMMAND ${PYTHON_EXECUTABLE} ${CONNECTOR_SETUP} build)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/connector/org.gnome.chrome_gnome_shell.json"
"${CMAKE_BINARY_DIR}/")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/connector/org.gnome.ChromeGnomeShell.service.in"
"${CMAKE_BINARY_DIR}/org.gnome.ChromeGnomeShell.service")
add_custom_target(firefox-native-manifest ALL
COMMAND "${JQ_EXECUTABLE}" -s "'add|del(.allowed_origins)'"
"${CMAKE_BINARY_DIR}/org.gnome.chrome_gnome_shell.json"
"${CMAKE_CURRENT_SOURCE_DIR}/connector/org.gnome.chrome_gnome_shell.firefox.json"
> "${CMAKE_BINARY_DIR}/org.gnome.chrome_gnome_shell.firefox.json")
if(USE_DEBIAN_LAYOUT)
set(DISTUTILS_EXTRA_ARGS "--install-layout=deb")
else()
set(DISTUTILS_EXTRA_ARGS "")
endif(USE_DEBIAN_LAYOUT)
install(CODE "
if(DEFINED ENV{DESTDIR})
set(DESTDIR \"\$ENV{DESTDIR}\")
else(DEFINED ENV{DESTDIR})
set(DESTDIR \"/\")
endif(DEFINED ENV{DESTDIR})
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CONNECTOR_SETUP}
install ${DISTUTILS_EXTRA_ARGS}
--root \"\${DESTDIR}\"
--prefix \"${CMAKE_INSTALL_PREFIX}\")")
if(NOT CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
install(FILES "${CMAKE_BINARY_DIR}/org.gnome.chrome_gnome_shell.json" DESTINATION "/etc/chromium/native-messaging-hosts/")
install(FILES "${CMAKE_BINARY_DIR}/org.gnome.chrome_gnome_shell.json" DESTINATION "/etc/opt/chrome/native-messaging-hosts/")
else(NOT CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
# FreeBSD uses patch that forces Chromium to look into undocumented
# "/usr/local/etc/chrome/native-messaging-hosts" folder for native messaging host manifest.
# https://github.com/freebsd/freebsd-ports/blob/master/www/chromium/files/patch-chrome_common_chrome__paths.cc
install(FILES "${CMAKE_BINARY_DIR}/org.gnome.chrome_gnome_shell.json" DESTINATION "/usr/local/etc/chrome/native-messaging-hosts/")
endif(NOT CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
install(FILES "${CMAKE_BINARY_DIR}/org.gnome.chrome_gnome_shell.firefox.json"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/mozilla/native-messaging-hosts/"
RENAME "org.gnome.chrome_gnome_shell.json")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/connector/org.gnome.ChromeGnomeShell.desktop" DESTINATION "${CMAKE_INSTALL_DATADIR}/applications/")
install(FILES "${CMAKE_BINARY_DIR}/org.gnome.ChromeGnomeShell.service" DESTINATION "${CMAKE_INSTALL_DATADIR}/dbus-1/services/")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/extension/icons/GnomeLogo-16.png"
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/gnome/16x16/apps/"
RENAME org.gnome.ChromeGnomeShell.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/extension/icons/GnomeLogo-48.png"
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/gnome/48x48/apps/"
RENAME org.gnome.ChromeGnomeShell.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/extension/icons/GnomeLogo-128.png"
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/gnome/128x128/apps/"
RENAME org.gnome.ChromeGnomeShell.png)
endif(BUILD_CONNECTOR)
if(BUILD_SOURCE_PACKAGE)
set(MESSAGE_NO_DIST "Unable to generate dist target. Dependencies missing.")
find_program_ex(xz WARNING)
find_package(Git)
if(GIT_FOUND AND XZ_FOUND)
# http://agateau.com/2009/cmake-and-make-dist-the-simple-version/
add_custom_target(dist
COMMAND ${GIT_EXECUTABLE} archive --prefix=${ARCHIVE_NAME}/ HEAD | ${XZ_EXECUTABLE} -z > ${CMAKE_BINARY_DIR}/${ARCHIVE_FULL_NAME}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
else(GIT_FOUND AND XZ_FOUND)
if(BUILD_DEB)
message(FATAL_ERROR ${MESSAGE_NO_DIST})
else(BUILD_DEB)
message(WARNING ${MESSAGE_NO_DIST})
endif(BUILD_DEB)
endif(GIT_FOUND AND XZ_FOUND)
if(BUILD_DEB)
find_program_ex(debuild FATAL_ERROR)
find_program_ex(tar FATAL_ERROR)
if(GPG_KEY)
message(STATUS "Using GPG key ${GPG_KEY}")
set(DEBUILD_KEY "-k${GPG_KEY}")
else(GPG_KEY)
message(STATUS "GPG_KEY not set. Using default GPG key")
endif(GPG_KEY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/contrib/ubuntu/changelog"
"${CMAKE_BINARY_DIR}/debian_changelog")
add_custom_target(deb_prepare
DEPENDS dist
COMMAND ${CMAKE_COMMAND} -E make_directory "${DEB_DIR}/${ARCHIVE_NAME}"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/${ARCHIVE_FULL_NAME}" "${DEB_DIR}/${ARCHIVE_DEB_NAME}"
COMMAND ${TAR_EXECUTABLE} -xvf "${DEB_DIR}/${ARCHIVE_DEB_NAME}" -C "${DEB_DIR}/${ARCHIVE_NAME}" --strip-components=1)
add_custom_target(deb ALL
DEPENDS deb_prepare
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/contrib/ubuntu" "${DEB_DIR}/${ARCHIVE_NAME}/debian"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/debian_changelog" "${DEB_DIR}/${ARCHIVE_NAME}/debian/changelog"
COMMAND ${DEBUILD_EXECUTABLE} -S ${DEBUILD_KEY}
WORKING_DIRECTORY ${DEB_DIR}/${ARCHIVE_NAME})
endif(BUILD_DEB)
endif(BUILD_SOURCE_PACKAGE)
if(BUILD_MESSAGES)
find_package(Gettext)
if(NOT GETTEXT_FOUND)
message(FATAL_ERROR "Gettext not found")
endif(NOT GETTEXT_FOUND)
add_custom_target(generate-pot
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/contrib/chrome-messages2po.py
--email ${GETTEXT_REPORT_EMAIL}
--reference-lang en
--write-pot
${CMAKE_CURRENT_SOURCE_DIR}/contrib/chrome-web-store/
${CMAKE_CURRENT_SOURCE_DIR}/extension/_locales/
${CMAKE_CURRENT_SOURCE_DIR}/po/)
add_custom_target(update-po
DEPENDS generate-pot)
file(GLOB PO_FILES
LIST_DIRECTORIES false
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po/
${CMAKE_CURRENT_SOURCE_DIR}/po/*.po)
foreach(PO ${PO_FILES})
add_custom_command(TARGET update-po
COMMENT "Updating ${PO}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/po
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} -q --update
${PO}
${CMAKE_CURRENT_SOURCE_DIR}/po/template.pot)
endforeach()
add_custom_command(TARGET update-po
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/po/*.po~)
add_custom_target(build-messages ALL
DEPENDS update-po
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/contrib/po2chrome-messages.py
--reference-lang en
${CMAKE_CURRENT_SOURCE_DIR}/contrib/chrome-web-store/
${CMAKE_CURRENT_SOURCE_DIR}/extension/_locales/
${CMAKE_CURRENT_SOURCE_DIR}/po/)
endif(BUILD_MESSAGES)
= 2018-03-21 chrome-gnome-shell 10.1 =
= 2022-09-07 gnome-browser-connector 42.1 =
== Changes ==
* Firefox: multiple fixes of GNOME Shell extensions synchronization.
* Firefox 56 is minimum supported version now. ESR users should use browser extension
version 10.0.1.
* Added detected python path in scripts shebang.
* Restored compatibility with Python 3.8.
* Fix errors in `get_variant` helper that leads to connector crash (Martin D).
* Fixed build system error when python dependencies are missing.
== Translations ==
* Croatian (gogo)
* Danish (Alan Mortensen, Ask Hjorth Larsen)
* Dutch (Nathan Follens)
* Estonian (Liivia Lilleväli, Mart Raudsepp)
* German (Mario Blättermann)
* Hungarian (Balázs Úr)
* Indonesian (Kukuh Syafaat)
* Serbian (Мирослав Николић)
* Spanish (Daniel Mustieles)
* Turkish (Emin Tufan Çetin)
== Known issues ==
* In Firefox with enabled synchronization of GNOME Shell extensions all Shell extensions may be
removed after screen got locked because of missed support of "locked" idle state
in WebExtensions API implementation
(https://developer.mozilla.org/ru/Add-ons/WebExtensions/API/idle/onStateChanged).
* Chrome extension may be auto uninstalled after upgrade to connector version 10.
It can be restored using inline installation link at https://extensions.gnome.org or using
Chrome Store (https://chrome.google.com/webstore/detail/gphhapmejobijbbhgpjhcjognlahblep).
* Firefox can consume a lot of CPU and sometime crash on quit because of Mozilla's bug 1349874
(https://bugzilla.mozilla.org/show_bug.cgi?id=1349874).
= 2022-07-23 gnome-browser-connector 42.0 =
== Changes ==
* Website API is updated to version 6.
It is now possible to control `disable-user-extensions` and `disable-extension-version-validation`
Shell settings via website.
You need GNOME browser extension 11 for this feature to work.
* Implemented `gnome-extensions://` URI handler so it will be possible to install extensions
via website without `gnome-browser-extension`.
* Removed extensions update check in favour of GNOME Shell 3.36+ built-in functionality.
* Install icons in hicolor theme (Florian Müllner).
* Dropped Python 2 compatibility. Minimal supported Python version is 3.8 now.
= 2018-02-04 chrome-gnome-shell 10 =
......
GNOME Shell integration for Chrome
============================================
[![Code Health](https://landscape.io/github/nE0sIghT/chrome-gnome-shell-mirror/master/landscape.svg?style=flat)](https://landscape.io/github/nE0sIghT/chrome-gnome-shell-mirror/master)
# GNOME Shell browser connector
## Introduction
Introduction
------------
This repository contains OS-native connector counterpart for [GNOME Shell browser extension](https://gitlab.gnome.org/GNOME/chrome-gnome-shell).
This repository contains Browser extension for Google Chrome/Chromium, Firefox, Vivaldi, Opera (and other
Browser Extension, Chrome Extension or WebExtensions capable browsers) and native host messaging connector
that provides integration with GNOME Shell and the corresponding extensions repository https://extensions.gnome.org/.
## Build and install
Requirements
------------
* GNOME Shell up to 3.22
* Python 2.7+ or 3.x
* PyGObject
* Python Requests 2.x
First you need to install build requirements:
- meson
- python3
- pygobject
Installation
------------
Recent installation instructions are [available in GNOME wiki](https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation).
Then invoke meson to build and install connector:
```shell
meson --prefix=/usr builddir
cd builddir
meson install
```
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=GNOME Shell integration
Comment=Provides integration with GNOME Shell and the corresponding extensions repository https://extensions.gnome.org.
Icon=org.gnome.ChromeGnomeShell
DBusActivatable=true
NoDisplay=true
[D-BUS Service]
Name=org.gnome.ChromeGnomeShell
Exec=${CMAKE_INSTALL_FULL_BINDIR}/chrome-gnome-shell --gapplication-service
{
"name": "org.gnome.chrome_gnome_shell",
"description": "Native connector for extensions.gnome.org",
"path": "${CMAKE_INSTALL_FULL_BINDIR}/chrome-gnome-shell",
"type": "stdio",
"allowed_origins": [
"chrome-extension://${CHROME_EXTENSION_ID}/",
"chrome-extension://${OPERA_EXTENSION_ID}/"
]
}
#!/usr/bin/env python
import os
import shutil
from distutils.core import setup
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
BUILD_DIR = SCRIPT_DIR + '/../build'
SCRIPT_PATH = BUILD_DIR + '/chrome-gnome-shell'
if not os.path.exists(BUILD_DIR):
os.makedirs(BUILD_DIR)
shutil.copyfile(SCRIPT_DIR + '/chrome-gnome-shell.py', SCRIPT_PATH)
setup(
name='chrome-gnome-shell',
description='Provides integration with GNOME Shell extensions repository for Chrome browser',
author='Yuri Konotopov',
url='https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome',
scripts=[SCRIPT_PATH]
)
#!/usr/bin/python3
import argparse
import json
import os
import sys
def main():
parser = argparse.ArgumentParser(os.path.basename(sys.argv[0]))
parser.add_argument(
"--delete",
default='',
help="Remove keys from json, comma separated"
)
parser.add_argument(
"--output",
required=True,
help="Write output to file"
)
parser.add_argument(
"input",
nargs='+',
help="Chrome extension key"
)
args = parser.parse_args()
output = {}
for file in args.input:
with open(file, 'r') as fp:
data = json.load(fp)
for key in args.delete.split(','):
if key in data:
del data[key]
output = {**output, **data}
with open(args.output, 'w') as fp:
json.dump(output, fp, ensure_ascii=False, indent=2)
if __name__ == '__main__':
main()
[Desktop Entry]
Type=Application
Exec=@bindir@/gnome-browser-connector %u
Encoding=UTF-8
Name=GNOME browser connector
Comment=OS-native connector counterpart for GNOME Shell browser extension
Icon=org.gnome.BrowserConnector
DBusActivatable=true
NoDisplay=true
MimeType=x-scheme-handler/gnome-extensions;
[D-BUS Service]
Name=org.gnome.BrowserConnector
Exec=@bindir@/gnome-browser-connector --gapplication-service
{
"name": "org.gnome.browser_connector",
"description": "OS-native connector counterpart for GNOME Shell browser extension",
"path": "@bindir@/gnome-browser-connector-host",
"type": "stdio",
"allowed_origins": [
"chrome-extension://gphhapmejobijbbhgpjhcjognlahblep/"
]
}
{
"name": "org.gnome.chrome_gnome_shell"
}
{
"_DO_NOT_EDIT": {
"description": "This file is auto generated with po2chrome-messages tool from ca.po.",
"message": ""
},
"close": {
"message": "Tanca"
},
"error_connector_response": {
"description": "Shown to user when response from connector API call does not follow known format.",
"message": "S'ha rebut una resposta incorrecta d'un connector"
},
"extension_enabled": {
"description": "Used as title, eg in table header. Means 'Does GNOME Shell extension enabled?'",
"message": "Habilitat"
},
"extension_installed": {
"description": "Used as title, eg in table header. Means 'Does GNOME Shell extension installed?'",
"message": "Instal\u00b7lat"
},
"extension_name": {
"description": "Used as title, eg in table header. Means 'GNOME Shell extension name'.",
"message": "Extensi\u00f3"
},
"extension_status_downgrade": {
"description": "This is a part of phrase like 'Extension Top Icons must be downgraded'.",
"message": "ha de ser revertit"
},
"extension_status_upgrade": {
"description": "This is a part of phrase like 'Extension Top Icons can be upgraded'.",
"message": "pot actualitzar-se"
},
"extension_synchronized": {
"description": "Used as title, eg in table header. Means 'Does GNOME Shell extension status synchronized with remote browser storage?'",
"message": "Sincronitzaci\u00f3"
},
"gs_chrome": {
"description": "This is a project title. Used as extension name in Chrome Store and in some titlebars.",
"message": "Integraci\u00f3 amb el GNOME Shell"
},
"hours": {
"description": "This is a part of phrase 'Update check period: xx hours'",
"message": "hores"
},
"manifest_description": {
"description": "Used as extension description in Chrome Store",
"message": "Aquesta extensi\u00f3 proporciona integraci\u00f3 amb GNOME Shell i el corresponent dip\u00f2sit d'extensions https://extensions.gnome.org"
},
"native_request_failed": {
"description": "$REQUEST$ is a placeholder for technical name of request that web extension make via native messaging host application.",
"message": "La sol\u00b7licitud nativa \u00ab$REQUEST$\u00bb ha fallat",
"placeholders": {
"request": {
"content": "$1"
}
}
},
"never": {
"description": "This is a part of phrase 'Last check: never'",
"message": "mai"
},
"no": {
"message": "No"
},
"no_gnome_shell": {
"description": "Shown to user when native connector unable to query GNOME Shell version or settings",
"message": "No es pot localitzar la configuraci\u00f3 del GNOME Shell o la versi\u00f3. Assegureu-vos que est\u00e0 instal\u00b7lat i en execuci\u00f3."
},
"no_host_connector": {
"message": "Encara que l'extensi\u00f3 d'integraci\u00f3 del GNOME Shell est\u00e0 executant-se, no s'ha detectat el connector amfitri\u00f3 nadiu. Vegeu la <a href='https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation'>documentaci\u00f3</a> per obtenir instruccions de com instal\u00b7lar el connector."
},
"no_host_response": {
"description": "Means 'Web extension does not received answer from native messaging host application.'",
"message": "Sense resposta de l'amfitri\u00f3:"
},
"open_website": {
"description": "Tooltip for browser extensions icon.",
"message": "Obre el lloc web d'extensions del GNOME Shell"
},
"options_check_period": {
"description": "Option name. Allow to set interval between GNOME Shell extensions update checks.",
"message": "Per\u00edode de comprovaci\u00f3 d'actualitzacions"
},
"options_last_check": {
"description": "This is a start of phrase (followed by date/time) of last GNOME Shell extensions update check.",
"message": "Darrera comprovaci\u00f3"
},
"options_link": {
"description": "Link name for options tab.",
"message": "Opcions"
},
"options_next_check": {
"description": "This is a start of phrase (followed by date/time) of next GNOME Shell extensions update check.",
"message": "Propera comprovaci\u00f3"
},
"options_saved": {
"description": "Means 'Options were saved successfully after user clicked Save button'",
"message": "Configuraci\u00f3 desada."
},
"options_show_release_notes": {
"description": "Option name. Allow to enable/disable popup with release notes when Web extension is updated.",
"message": "Mostra les notes de la versi\u00f3 quan s'actualitza l'extensi\u00f3 del navegador"
},
"options_synchronize_extensions": {
"description": "Option name. Allow to enable/disable synchronization of GNOME Shell extensions with remote browser storage.",
"message": "Sincronitza la llista d'extensions del GNOME Shell"
},
"options_synchronize_extensions_notice": {
"description": "This is a notice under option name.",
"message": "Si s'habilita, la llista d'extensions del GNOME Shell es sincronitzar\u00e0 amb el compte de Google."
},
"options_title": {
"description": "$GS_CHROME$ is placeholder for 'GNOME Shell integration' string. This string used as title for Options page. This title is not shown in Chrome, but may be shown in other browsers.",
"message": "Opcions de $GS_CHROME$",
"placeholders": {
"gs_chrome": {
"content": "$1"
}
}
},
"options_update_check": {
"description": "Option name. Allow enable/disable update check for GNOME Shell extensions.",
"message": "Comprova si hi ha actualitzacions de l'extensi\u00f3 del Gnome Shell"
},
"options_update_check_enabled": {
"description": "Option name.",
"message": "Check update of enabled GNOME Shell extensions only"
},
"options_update_check_enabled_notice": {
"message": "Your native host connector does not support updates check for enabled GNOME Shell extensions only. Consider update."
},
"options_update_check_notice": {
"message": "El connector amfitri\u00f3 natiu no admet verificaci\u00f3 d'extensions actualitzades per al GNOME Shell. Probablement no es troba el paquet python-requests."
},
"options_use_light_icon": {
"description": "Use light icon that is looked better with dark themes.",
"message": "Use light icon (dark theme)"
},
"platform_not_supported": {
"message": "El connector amfitri\u00f3 nadiu no \u00e9s compatible amb aquesta plataforma."
},
"retry": {
"message": "Reintenta-ho"
},
"save": {
"message": "Desa"
},
"synchronization": {
"description": "Link name for synchronization tab in options dialog.",
"message": "Sincronitzaci\u00f3"
},
"synchronization_cancel": {
"message": "No habilitis la sincronitzaci\u00f3."
},
"synchronization_failed": {
"description": "$CAUSE$ is placeholder for error that caused synchronization failure.",
"message": "S'ha produ\u00eft un error en sincronitzar les extensions: $CAUSE$",
"placeholders": {
"cause": {
"content": "$1"
}
}
},
"synchronization_storage_exists": {
"message": "L'emmagatzematge remot per a la sincronitzaci\u00f3 ja cont\u00e9 una llista d'extensions."
},
"synchronization_use_local": {
"message": "Utilitza la llista local d'extensions, sobreescrivint la remota."
},
"synchronization_use_remote": {
"message": "Utilitza la llista remota d'extensions, sobreescrivint la local."
},
"translation_credits": {
"description": "This is content of 'About translation' tab in Options dialog. Thank you for translation and feel free to add yourself here. HTML markup enabled for this string. New line character is treated as line break (<br />)",
"message": "Jordi Mas i Hern\u00e0ndez <jmas@softcatala.org>"
},
"translation_credits_title": {
"description": "Link name for translation credits tab in options dialog.",
"message": "Quant a la traducci\u00f3"
},
"unknown_error": {
"description": "This should newer be shown to user. However better safe than sorry.",
"message": "error desconegut"
},
"update_available": {
"message": "Hi ha una actualitzaci\u00f3 disponible per a les extensions del GNOME Shell"
},
"update_check_failed": {
"description": "$CAUSE$ is placeholder for error that caused update failure.",
"message": "No s'ha pogut comprovar les extensions d'actualitzaci\u00f3 del GNOME Shell: $CAUSE$",
"placeholders": {
"cause": {
"content": "$1"
}
}
},
"warning_apis_missing": {
"description": "$$1 is a placeholder for a list of missing APIs",
"message": "El seu connector amfitri\u00f3 natiu no \u00e9s compatible amb les API's seg\u00fcents: $$1. Probablement s'hauria d'actualitzar el connector amfitri\u00f3 natiu o instal\u00b7lar connectors per a les API's que falten. Consulteu la documentaci\u00f3 de <a href='https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation'>documentation</a> per obtenir instruccions."
},
"yes": {
"message": "S\u00ed"
}
}
{
"_DO_NOT_EDIT": {
"description": "This file is auto generated with po2chrome-messages tool from cs.po.",
"message": ""
},
"close": {
"message": "Zav\u0159\u00edt"
},
"error_connector_response": {
"description": "Shown to user when response from connector API call does not follow known format.",
"message": "Obdr\u017eena nespr\u00e1vn\u00e1 odpov\u011b\u010f od konektoru"
},
"extension_enabled": {
"description": "Used as title, eg in table header. Means 'Does GNOME Shell extension enabled?'",
"message": "Povoleno"
},
"extension_installed": {
"description": "Used as title, eg in table header. Means 'Does GNOME Shell extension installed?'",
"message": "Nainstalov\u00e1no"
},
"extension_name": {
"description": "Used as title, eg in table header. Means 'GNOME Shell extension name'.",
"message": "Roz\u0161\u00ed\u0159en\u00ed"
},
"extension_status_downgrade": {
"description": "This is a part of phrase like 'Extension Top Icons must be downgraded'.",
"message": "mus\u00ed b\u00fdt vr\u00e1ceny na ni\u017e\u0161\u00ed verzi"
},
"extension_status_upgrade": {
"description": "This is a part of phrase like 'Extension Top Icons can be upgraded'.",
"message": "mohou b\u00fdt pov\u00fd\u0161eny"
},
"extension_synchronized": {
"description": "Used as title, eg in table header. Means 'Does GNOME Shell extension status synchronized with remote browser storage?'",
"message": "Synchronizov\u00e1no"
},
"gs_chrome": {
"description": "This is a project title. Used as extension name in Chrome Store and in some titlebars.",
"message": "Integrace do GNOME Shell"
},
"hours": {
"description": "This is a part of phrase 'Update check period: xx hours'",
"message": "hodin"
},
"manifest_description": {
"description": "Used as extension description in Chrome Store",
"message": "Toto roz\u0161\u00ed\u0159en\u00ed poskytuje integraci s GNOME Shell a shoduje se s repozit\u00e1\u0159em roz\u0161\u00ed\u0159en\u00ed https://extensions.gnome.org"
},
"native_request_failed": {
"description": "$REQUEST$ is a placeholder for technical name of request that web extension make via native messaging host application.",
"message": "P\u0159irozen\u00fd po\u017eadavek \u00ab$REQUEST$\u00bb selhal",
"placeholders": {
"request": {
"content": "$1"
}
}
},
"never": {
"description": "This is a part of phrase 'Last check: never'",
"message": "nikdy"
},
"no": {
"message": "Ne"
},
"no_gnome_shell": {
"description": "Shown to user when native connector unable to query GNOME Shell version or settings",
"message": "Nelze naj\u00edt nastaven\u00ed nebo verzi GNOME Shellu. Ujist\u011bte se, \u017ee je nainstalov\u00e1n a b\u011b\u017e\u00ed."
},
"no_host_connector": {
"message": "A\u010dkoliv roz\u0161\u00ed\u0159en\u00ed integruj\u00edc\u00ed GNOME Shell b\u011b\u017e\u00ed, nebyl nalezen konektor pro p\u0159irozen\u00e9ho hostitele. Pod\u00edvejte se do <a href='https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation'>dokumentace</a>, jak konektor nainstalovat."
},
"no_host_response": {
"description": "Means 'Web extension does not received answer from native messaging host application.'",
"message": "\u017d\u00e1dn\u00fd hostitel neodpov\u00edd\u00e1"
},
"open_website": {
"description": "Tooltip for browser extensions icon.",
"message": "Otev\u0159\u00edt webov\u00e9 str\u00e1nky roz\u0161\u00ed\u0159en\u00ed GNOME Shell"
},
"options_check_period": {
"description": "Option name. Allow to set interval between GNOME Shell extensions update checks.",
"message": "Aktualizovat dobu mezi kontrolami"
},
"options_last_check": {
"description": "This is a start of phrase (followed by date/time) of last GNOME Shell extensions update check.",
"message": "Posledn\u00ed kontrola"
},
"options_link": {
"description": "Link name for options tab.",
"message": "Volby"
},
"options_next_check": {
"description": "This is a start of phrase (followed by date/time) of next GNOME Shell extensions update check.",
"message": "P\u0159\u00ed\u0161t\u00ed kontrola"
},
"options_saved": {
"description": "Means 'Options were saved successfully after user clicked Save button'",
"message": "Volba byla ulo\u017eena."
},
"options_show_release_notes": {
"description": "Option name. Allow to enable/disable popup with release notes when Web extension is updated.",
"message": "Po aktualizaci roz\u0161\u00ed\u0159en\u00ed prohl\u00ed\u017ee\u010de zobrazit pozn\u00e1mky k vyd\u00e1n\u00ed"
},
"options_synchronize_extensions": {
"description": "Option name. Allow to enable/disable synchronization of GNOME Shell extensions with remote browser storage.",
"message": "Synchronizovat seznam roz\u0161\u00ed\u0159en\u00ed GNOME Shell"
},
"options_synchronize_extensions_notice": {
"description": "This is a notice under option name.",
"message": "Kdy\u017e je povoleno, bude v\u00e1\u0161 seznam roz\u0161\u00ed\u0159en\u00ed GNOME Shell synchronizov\u00e1n s va\u0161\u00edm \u00fa\u010dtem Google."
},
"options_title": {
"description": "$GS_CHROME$ is placeholder for 'GNOME Shell integration' string. This string used as title for Options page. This title is not shown in Chrome, but may be shown in other browsers.",
"message": "Volby $GS_CHROME$",
"placeholders": {
"gs_chrome": {
"content": "$1"
}
}
},
"options_update_check": {
"description": "Option name. Allow enable/disable update check for GNOME Shell extensions.",
"message": "Kontrolovat aktualizace roz\u0161\u00ed\u0159en\u00ed GNOME Shell"
},
"options_update_check_enabled": {
"description": "Option name.",
"message": "Kontrolovat aktualizace jen pro povolen\u00e1 roz\u0161\u00ed\u0159en\u00ed GNOME Shell"
},
"options_update_check_enabled_notice": {
"message": "V\u00e1\u0161 konektor pro p\u0159irozen\u00e9ho hostitele nepodporuje kontrolu aktualizac\u00ed jen pro zapnut\u00e1 roz\u0161\u00ed\u0159en\u00ed GNOME Shellu. Zva\u017ete p\u0159echod na nov\u011bj\u0161\u00ed verzi."
},
"options_update_check_notice": {
"message": "V\u00e1\u0161 konektor pro p\u0159irozen\u00e9ho hostitele nepodporuje kontrolu pro aktualizace roz\u0161\u00ed\u0159en\u00ed GNOME Shellu. Nejsp\u00ed\u0161e chyb\u00ed bal\u00ed\u010dek python-requests."
},
"options_use_light_icon": {
"description": "Use light icon that is looked better with dark themes.",
"message": "Pou\u017e\u00edvat sv\u011btl\u00e9 ikony (tmav\u00fd motiv)"
},
"platform_not_supported": {
"message": "Konektor pro p\u0159irozen\u00e9ho hostitele nen\u00ed va\u0161\u00ed platformou podporov\u00e1n."
},
"retry": {
"message": "Zkusit znovu"
},
"save": {
"message": "Ulo\u017eit"
},
"synchronization": {
"description": "Link name for synchronization tab in options dialog.",
"message": "Synchronizace"
},
"synchronization_cancel": {
"message": "Nezap\u00ednat synchronizaci."
},
"synchronization_failed": {
"description": "$CAUSE$ is placeholder for error that caused synchronization failure.",
"message": "Selhala synchronizace roz\u0161\u00ed\u0159en\u00ed: $CAUSE$",
"placeholders": {
"cause": {
"content": "$1"
}
}
},
"synchronization_storage_exists": {
"message": "Va\u0161e vzd\u00e1len\u00e9 \u00falo\u017ei\u0161t\u011b synchronizac\u00ed ji\u017e obsahuje seznam roz\u0161\u00ed\u0159en\u00ed."
},
"synchronization_use_local": {
"message": "Pou\u017e\u00edt m\u00edstn\u00ed seznam roz\u0161\u00ed\u0159en\u00ed, p\u0159epsat vzd\u00e1len\u00fd."
},
"synchronization_use_remote": {
"message": "Pou\u017e\u00edt vzd\u00e1len\u00fd seznam roz\u0161\u00ed\u0159en\u00ed, p\u0159epsat m\u00edstn\u00ed."
},
"translation_credits": {
"description": "This is content of 'About translation' tab in Options dialog. Thank you for translation and feel free to add yourself here. HTML markup enabled for this string. New line character is treated as line break (<br />)",
"message": "Marek \u010cernock\u00fd <marek@manet.cz>"
},
"translation_credits_title": {
"description": "Link name for translation credits tab in options dialog.",
"message": "O p\u0159ekladu"
},
"unknown_error": {
"description": "This should newer be shown to user. However better safe than sorry.",
"message": "nezn\u00e1m\u00e1 chyba"
},
"update_available": {
"message": "Je dostupn\u00e1 aktualizace roz\u0161\u00ed\u0159en\u00ed GNOME Shell"
},
"update_check_failed": {
"description": "$CAUSE$ is placeholder for error that caused update failure.",
"message": "Selhala kontrola aktualizac\u00ed roz\u0161\u00ed\u0159en\u00ed GNOME Shell: $CAUSE$",
"placeholders": {
"cause": {
"content": "$1"
}
}
},
"warning_apis_missing": {
"description": "$$1 is a placeholder for a list of missing APIs",
"message": "Konektor pro va\u0161eho p\u0159irozen\u00e9ho hostitele nepodporuje n\u00e1sleduj\u00edc\u00ed API: $$1. Pravd\u011bpodobn\u011b jej budete muset pov\u00fd\u0161it na nov\u011bj\u0161\u00ed verzi nebo nainstalovat z\u00e1suvn\u00fd modul pro chyb\u011bj\u00edc\u00ed API. Na instrukce se pod\u00edvejte se do <a href='https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation'>dokumentace</a>."
},
"yes": {
"message": "Ano"
}
}