How to define setter/getter on prototype

EDIT Oct 2016: Please note this question was asked in 2012. Every month or so someone adds a new answer or comment that refutes an answer, but doesn't really make sense to do so as the question is...

GJS read file synchronously

I'm trying to use GJS and more precisely to read a text file in a synchronous way. Here is an example an the asynchronous function for file reading gio-cat.js I found how to proceed with seed...

How to install two different version of same package with yum

Say I want to install two different versions of same package. To be specific, I want to install two versions of Javascript binding for GNOME, gjs package. I want to have...

How to use C libraries to create GNOME app in JavaScript

I am a beginner in GNOME desktop application development so I am trying to learn about it as much as possible. I have read various tutorials present on developer.gnome.org written for JavaScript....

Use Eclipse as GNOME Extension IDE

I am trying to develop my own GNOME Extension. I have read several articles: gnome-shell-extensions-getting-started gnome-whiteboards-hello-ide and the official...

Getting keyboard modifiers state using Gnome libs (GDK) fetches initial state only

I'm trying to get the current keyboard modifiers state through gnome GDK or GTK library in aim to implement an accessibility gnome shell extension that shows that state. I know how to get thier...

read asynchronous stdout from gjs

I am trying to run a command from gjs and read the output asynchronously. here is my synchronous code let [res, pid, in_fd, out_fd, err_fd] = GLib.spawn_async_with_pipes(null, ...

gjs/gnome-shell-extension: read remote jpg image from url and set as icon

I am trying to improve a gnome-shell-extension by allowing retrieving of remote image (jpg) and set as icon for a certain widget. Here is what I got so far, but it does not work, due to mismatch...

Gnome Extensions - Run shell command

I am writing a simple extension to open browser by clicking the extension button. I would like to know if there is a function which can execute passed shell command as argument. Also, it'd be...

Is it posible to have multiple grapesjs instances on the same page?

I am using Boostrap 4 Tabs. On each tab, I have an instance of grapesjs. One is using the webpage plugin: const productEditor = grapesjs.init({ container: '#gjs', ...

Adding component to blockManager in GrapesJS

So I started with grapesjs just the other day, and so far I love it. However, I have hit a road block. In the canvas (#gjs), I have a preset div container: <div id="container"></div> I can create...

JavaScript optimized version of ARGB to RGBA array conversion

I want to convert an Uint8Array of bytes that contains an ARGB image into its RGBA representation, however I would like to get that with something more opimized than what I propose here, using...

How to update widget when new style is applied

I'm making an extension with a list containing a checkbox with a text item (St.label) that change style when toggled. I'm listening to the toggle event, and as the item is toggled, I set a new...

How to move / drag element from outside to iframe

I need to move element from outside an iframe into an iframe. My element panel is not part of iframe but my canvas is in the iframe and want to move element into it. I tried below code : ...

Custom Icon for Gnome Shell Extension in Top Panel not visible

I try to use a custom SVG for my GNOME shell extension as status icon in top panel. But the custom icon is never shown, just the widget's label text. And I find no error in log output. When I try...

How to change class element from Dom component in GrapesJS

I've been looking for an answer for a bit now, and would like to find an answer. So here is the question : I need to update a class name of a GrapesDom element that have been added using...

GrapesJs and PHP - store and load data to show in editor and as HTML page as well

I am using GrapesJS to build a simple webpage. I included the script in the following way inside head part : <script type="text/javascript" src="js/jquery-1.10.2.js"></script> <link...

What's wrong with my gjs meson build setup?

I have a Gnome GJS app and would like to package it with Meson. The app source (in ./src) has subfolders lib, object, and ui. Each subfolder has a meson.build file that looks like this (for the...

Call a function from another gnome extension

My question is simple, is that possible to call a function declared in another gnome extension from my own gnome extension ?

Unable to Drag and drop into iframe using cypress

Hi I have to drag a component which is outside a frame and drop into a iframe body(dragable source) but it is not draging my component into iframe dragable source this is code which is am using...

GNOME Shell Extension Install possible without Restart?

I have written a small GNOME Shell extension, that I want to distribute to some collegues. For this I created a RPM. After the installation a restart of GNOME-Shell is needed to make the extension...

Which gnome function is responsible for switching workspaces?

Gio open "http://..." from terminal switches from the current workspace to the workspace where the default browser is. And the same happens when the links are opened from other apps (email...

Why doesn't overriding a class function work sometimes?

I followed this https://wiki.gnome.org/Projects/GnomeShell/Extensions/StepByStepTutorial for Overwriting a function. For example, I want to override the function _setupKeyboard() on the Keyboard...

Inline CKeditor integrated in GrapesJS editor

I'm working in an editor application where GrapesJS is implemented. Its editor and feature are working fine. I have integrated inline CKeditor to GrapesJS editor and it has few issues. Multiple...

Develop GJS in Visual Studio Code

When working with GJS there does not seem to be any documentation. Is there an integration for Visual Studio Code, at least?

How to Save a page assembled using GrapeJS to a database using ASP.NET MVC

Well, I am developing my own Content Management System using ASP.NET MVC and for a page builder I've decided to use GrapeJS. Now, since this is new to me, I can't seem to find a way to save the...

Gnome Shell Extension: Send Request with Authorization Bearer Headers

I am trying to build a gnome shell extension (using gjs) that I need to communicate with an external REST API. In order to do so, I need to accompany my requests with the header: Authorization:...

Reference to "window" in Gnome-shell for use in Gnome extensions

I want to understand how the variable "window" which has the attribute MetaWindow can be used in different functions and vars while not being explicitly defined such as let app =...

Sharing code between a GTK/GJS App and a Gnome Shell Extension

I am developing a GTK application in GJS and like to reuse parts of the GTK code inside a Gnome Shell extension. However, I did not find a way to add a Gtk.Widget to the menu of my Gnome Shell...

Introduction in developing Cinnamon Shell Extension (Desklet) in CJS / GJS (Gnome JavaScript)?

I started learning how to write Cinnamon extensions. Well, I try to ... While I managed to write a first simple desklet, I still didn't find a really good and up to date documentation and...