Skip to content

Commit 412533a

Browse files
committed
Revert "Adapt for GM 4+"; use GM_addStyle
1 parent 6b471ec commit 412533a

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

Periscope_Web_Client.meta.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @namespace https://greasyfork.org/users/23
55
// @description Periscope client based on API requests. Visit example.net for launch.
66
// @include https://api.twitter.com/oauth/authorize
7-
// @include http://example.net/*
7+
// @include http*://example.net/*
88
// @version 1.8
99
// @author Pmmlabs@github
1010
// @grant GM_xmlhttpRequest
@@ -23,4 +23,7 @@
2323
// @updateURL https://github.com/Pmmlabs/OpenPeriscope/raw/master/Periscope_Web_Client.meta.js
2424
// @icon https://github.com/Pmmlabs/OpenPeriscope/raw/master/images/openperiscope.png
2525
// @noframes
26+
// @grant GM_addStyle
27+
// @grant GM_getResourceText
28+
// @resource CSS style.css
2629
// ==/UserScript==

Periscope_Web_Client.user.js

+4-11
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @namespace https://greasyfork.org/users/23
55
// @description Periscope client based on API requests. Visit example.net for launch.
66
// @include https://api.twitter.com/oauth/authorize
7-
// @include http://example.net/*
7+
// @include http*://example.net/*
88
// @version 1.8
99
// @author Pmmlabs@github
1010
// @grant GM_xmlhttpRequest
@@ -23,17 +23,12 @@
2323
// @updateURL https://github.com/Pmmlabs/OpenPeriscope/raw/master/Periscope_Web_Client.meta.js
2424
// @icon https://github.com/Pmmlabs/OpenPeriscope/raw/master/images/openperiscope.png
2525
// @noframes
26-
// @grant GM.xmlHttpRequest
27-
// @grant GM.getResourceUrl
26+
// @grant GM_addStyle
27+
// @grant GM_getResourceText
2828
// @resource CSS style.css
2929
// ==/UserScript==
3030

3131
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-
}
3732
NODEJS = typeof GM_xmlhttpRequest === 'undefined';
3833
var IMG_PATH = 'https://raw.githubusercontent.com/Pmmlabs/OpenPeriscope/master';
3934
var settings = JSON.parse(localStorage.getItem('settings')) || {};
@@ -105,9 +100,7 @@ if (location.href == 'https://api.twitter.com/oauth/authorize') {
105100
if (NODEJS) {
106101
$(document.head).append('<link rel="stylesheet" href="/style.css" />')
107102
} else {
108-
GM_getResourceUrl("CSS").then(function(cssBlobUrl){
109-
$(document.head).append('<link rel="stylesheet" href="'+cssBlobUrl+'" />')
110-
});
103+
GM_addStyle(GM_getResourceText("CSS"));
111104
}
112105

113106
document.title = 'OpenPeriscope';

0 commit comments

Comments
 (0)