diff options
-rw-r--r-- | hint-tombloo.js | 3 | ||||
-rw-r--r-- | tombloo.js | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/hint-tombloo.js b/hint-tombloo.js index 09d9bd6..6ab3fcb 100644 --- a/hint-tombloo.js +++ b/hint-tombloo.js @@ -29,7 +29,8 @@ hints.addMode( hintKey, 'Share by Tombloo', function (elem) { - var tomblooService = Cc['@brasil.to/tombloo-service;1'].getService().wrappedJSObject.Tombloo.Service; + var tombloo = Cc['@tombfix.github.io/tombfix-service;1'] || Cc['@brasil.to/tombloo-service;1']; + var tomblooService = tombloo.getService().wrappedJSObject.Tombloo.Service; var d = window.content.document; var w = window.content.wrappedJSObject; @@ -103,12 +103,14 @@ commands.addUserCommand( // helper --- function getTombloo() { - const serviceId = '@brasil.to/tombloo-service;1'; + const serviceIds = ['@tombfix.github.io/tombfix-service;1', '@brasil.to/tombloo-service;1']; - if (!Cc[serviceId]) - throw new Error('Tombloo is not found. install from http://github.com/to/tombloo/wikis'); - - return Cc[serviceId].getService().wrappedJSObject; + for each (let serviceId in serviceIds) { + if (Cc[serviceId]) { + return Cc[serviceId].getService().wrappedJSObject; + } + } + throw new Error('Tombloo or Tombfix is not found. install from https://github.com/tombfix/core'); } function getContext() { |