diff --git a/js/misc/extensionUtils.js b/js/misc/extensionUtils.js index 9f77b4c40..6e39f87d7 100644 --- a/js/misc/extensionUtils.js +++ b/js/misc/extensionUtils.js @@ -112,6 +112,8 @@ function createExtensionObject(uuid, dir, type) { let metadataContents, success, tag; try { [success, metadataContents, tag] = metadataFile.load_contents(null); + if (metadataContents instanceof Uint8Array) + metadataContents = imports.byteArray.toString(metadataContents); } catch (e) { throw new Error('Failed to load metadata.json: ' + e); } diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 1fefb8c6c..1666a507b 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -472,6 +472,8 @@ var KeyboardModel = new Lang.Class({ _loadModel(groupName) { let file = Gio.File.new_for_uri('resource:///org/gnome/shell/osk-layouts/%s.json'.format(groupName)); let [success, contents] = file.load_contents(null); + if (contents instanceof Uint8Array) + contents = imports.byteArray.toString(contents); return JSON.parse(contents); }, diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js index 9b5986985..8ef20b67b 100644 --- a/js/ui/padOsd.js +++ b/js/ui/padOsd.js @@ -313,6 +313,8 @@ var PadDiagram = new Lang.Class({ _init(params) { let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/pad-osd.css'); let [success, css, etag] = file.load_contents(null); + if (css instanceof Uint8Array) + css = imports.byteArray.toString(css); this._curEdited = null; this._prevEdited = null; this._css = css; diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js index aac29ae5e..e22176415 100644 --- a/js/ui/sessionMode.js +++ b/js/ui/sessionMode.js @@ -117,6 +117,8 @@ function _loadMode(file, info) { let fileContent, success, tag, newMode; try { [success, fileContent, tag] = file.load_contents(null); + if (fileContent instanceof Uint8Array) + fileContent = imports.byteArray.toString(fileContent); newMode = JSON.parse(fileContent); } catch(e) { return;