{"action":"created","issue":{"url":"https://api.github.com/repos/linuxmint/Cinnamon/issues/4656","labels_url":"https://api.github.com/repos/linuxmint/Cinnamon/issues/4656/labels{/name}","comments_url":"https://api.github.com/repos/linuxmint/Cinnamon/issues/4656/comments","events_url":"https://api.github.com/repos/linuxmint/Cinnamon/issues/4656/events","html_url":"https://github.com/linuxmint/Cinnamon/issues/4656","id":108463669,"number":4656,"title":"Implement some ExtensionUtils.getCurrentExtension()","user":{"login":"Keruspe","id":222942,"avatar_url":"https://avatars.githubusercontent.com/u/222942?v=3","gravatar_id":"","url":"https://api.github.com/users/Keruspe","html_url":"https://github.com/Keruspe","followers_url":"https://api.github.com/users/Keruspe/followers","following_url":"https://api.github.com/users/Keruspe/following{/other_user}","gists_url":"https://api.github.com/users/Keruspe/gists{/gist_id}","starred_url":"https://api.github.com/users/Keruspe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keruspe/subscriptions","organizations_url":"https://api.github.com/users/Keruspe/orgs","repos_url":"https://api.github.com/users/Keruspe/repos","events_url":"https://api.github.com/users/Keruspe/events{/privacy}","received_events_url":"https://api.github.com/users/Keruspe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-26T13:26:08Z","updated_at":"2015-10-10T14:30:15Z","closed_at":null,"body":"While porting an extension from gnome-shell to cinnamon, a lot of code can be reused (at least for applets), only some boilerplate require changes.\r\nIt's currently not possible for the ones split into several files as they all use gnome-shell provided ExtensionUtils.getCurrentExtension() to import other files from the same extension.\r\n\r\nImplementing this would facilitate compatibility a lot."},"comment":{"url":"https://api.github.com/repos/linuxmint/Cinnamon/issues/comments/147094015","html_url":"https://github.com/linuxmint/Cinnamon/issues/4656#issuecomment-147094015","issue_url":"https://api.github.com/repos/linuxmint/Cinnamon/issues/4656","id":147094015,"user":{"login":"pixunil","id":7093655,"avatar_url":"https://avatars.githubusercontent.com/u/7093655?v=3","gravatar_id":"","url":"https://api.github.com/users/pixunil","html_url":"https://github.com/pixunil","followers_url":"https://api.github.com/users/pixunil/followers","following_url":"https://api.github.com/users/pixunil/following{/other_user}","gists_url":"https://api.github.com/users/pixunil/gists{/gist_id}","starred_url":"https://api.github.com/users/pixunil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixunil/subscriptions","organizations_url":"https://api.github.com/users/pixunil/orgs","repos_url":"https://api.github.com/users/pixunil/repos","events_url":"https://api.github.com/users/pixunil/events{/privacy}","received_events_url":"https://api.github.com/users/pixunil/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T14:30:15Z","updated_at":"2015-10-10T14:30:15Z","body":"If you look for a function to import files, look at [#4537](https://github.com/linuxmint/Cinnamon/pull/4537#issue-102391191) for a possibility.\r\nThe currently supported and safe method is getting one of these, depending on your xlet type:\r\n```javascript\r\nlet files = imports.ui.appletManager.applets[uuid];\r\nlet files = imports.ui.deskletManager.desklets[uuid];\r\nlet files = imports.ui.extensionSystem.extension[uuid];\r\n```\r\n\r\nIt will return an import object, similar to `imports`, but pointng to your xlet directory.\r\nAs you can see, you'll need to pass the `uuid`."}}