|
4 | 4 | // @namespace https://greasyfork.org/users/23
|
5 | 5 | // @description Periscope client based on API requests. Visit example.net for launch.
|
6 | 6 | // @include https://api.twitter.com/oauth/authorize
|
7 |
| -// @include http://example.net/* |
| 7 | +// @include http*://example.net/* |
8 | 8 | // @version 1.8
|
9 | 9 | // @author Pmmlabs@github
|
10 | 10 | // @grant GM_xmlhttpRequest
|
|
23 | 23 | // @updateURL https://github.com/Pmmlabs/OpenPeriscope/raw/master/Periscope_Web_Client.meta.js
|
24 | 24 | // @icon https://github.com/Pmmlabs/OpenPeriscope/raw/master/images/openperiscope.png
|
25 | 25 | // @noframes
|
26 |
| -// @grant GM.xmlHttpRequest |
27 |
| -// @grant GM.getResourceUrl |
| 26 | +// @grant GM_addStyle |
| 27 | +// @grant GM_getResourceText |
28 | 28 | // @resource CSS style.css
|
29 | 29 | // ==/UserScript==
|
30 | 30 |
|
31 | 31 | var emoji = new EmojiConvertor();
|
32 |
| -if (typeof GM_xmlhttpRequest === 'undefined' && typeof GM !== 'undefined') { |
33 |
| - // Greasemonkey 4+ |
34 |
| - GM_xmlhttpRequest = GM.xmlHttpRequest; |
35 |
| - GM_getResourceUrl = GM.getResourceUrl; |
36 |
| -} |
37 | 32 | NODEJS = typeof GM_xmlhttpRequest === 'undefined';
|
38 | 33 | var IMG_PATH = 'https://raw.githubusercontent.com/Pmmlabs/OpenPeriscope/master';
|
39 | 34 | var settings = JSON.parse(localStorage.getItem('settings')) || {};
|
@@ -105,9 +100,7 @@ if (location.href == 'https://api.twitter.com/oauth/authorize') {
|
105 | 100 | if (NODEJS) {
|
106 | 101 | $(document.head).append('<link rel="stylesheet" href="/style.css" />')
|
107 | 102 | } else {
|
108 |
| - GM_getResourceUrl("CSS").then(function(cssBlobUrl){ |
109 |
| - $(document.head).append('<link rel="stylesheet" href="'+cssBlobUrl+'" />') |
110 |
| - }); |
| 103 | + GM_addStyle(GM_getResourceText("CSS")); |
111 | 104 | }
|
112 | 105 |
|
113 | 106 | document.title = 'OpenPeriscope';
|
|
0 commit comments