Skip to content

Commit 0d7e95c

Browse files
committed
* Removed GM_addStyle as it gives errors in GreaseMonkey (not Scriptish);
* Works with v1.1.57;
1 parent ff1c239 commit 0d7e95c

2 files changed

Lines changed: 31 additions & 8 deletions

File tree

Horizon_TV_Fixer/155147.user.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// ==UserScript==
22
// @name Horizon TV Fixer
3-
// @namespace https://github.com/jerone/UserScripts/
3+
// @namespace https://github.com/jerone/UserScripts
44
// @description Fixes some issues & styles and adds some new features on Horizon TV Gids.
5-
// @homepage https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer/
6-
// @homepageURL https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer/
5+
// @author jerone
6+
// @homepage https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer
7+
// @homepageURL https://github.com/jerone/UserScripts/tree/master/Horizon_TV_Fixer
78
// @downloadURL https://github.com/jerone/UserScripts/raw/master/Horizon_TV_Fixer/155147.user.js
9+
// @updateURL https://github.com/jerone/UserScripts/raw/master/Horizon_TV_Fixer/155147.user.js
810
// @include *horizon.tv*
9-
// @version 18
10-
// @grant GM_addStyle
11+
// @version 19
12+
// @grant none
1113
// ==/UserScript==
1214

1315
(function HorizonTVFixer(){
@@ -116,7 +118,7 @@
116118
});
117119

118120
/* Style fixes; */
119-
GM_addStyle(
121+
addStyle(
120122
/* removed white header; */ "\
121123
.servicenav.service { \
122124
display: none; \
@@ -172,6 +174,16 @@
172174
} "+
173175
"");
174176

177+
function addStyle(css){
178+
var heads = document.getElementsByTagName("head");
179+
if (heads.length > 0) {
180+
var node = document.createElement("style");
181+
node.type = "text/css";
182+
node.appendChild(document.createTextNode(css));
183+
heads[0].appendChild(node);
184+
}
185+
}
186+
175187
function PageLoad(done){
176188
if(unsafeWindow.$){
177189
//unsafeWindow.$(function(){console.log("events: ", unsafeWindow.$(".channel-guide").data("events") );});

Horizon_TV_Fixer/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Fixes some issues & styles and adds some new features on [Horizon TV Gids](https
1313
* Add link to KijkWijzer (Dutch);
1414
* Add link to Uitzending Gemist (Dutch);
1515
* Add link to IPTorrents;
16-
* Add tooltips;
16+
* Add missing tooltips;
1717
* Style fixes;
1818

1919
### Screenshot
@@ -23,12 +23,23 @@ Fixes some issues & styles and adds some new features on [Horizon TV Gids](https
2323
### Compatible
2424

2525
- [![](https://raw.github.com/jerone/UserScripts/master/_resources/Greasemonkey.png) Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox Desktop](http://www.mozilla.org/en-US/firefox/fx/#desktop).
26+
* [![](https://raw.github.com/jerone/UserScripts/master/_resources/Scriptish.png) Scriptish](https://addons.mozilla.org/firefox/addon/scriptish/) on [![](https://raw.github.com/jerone/UserScripts/master/_resources/Firefox.png) Mozilla Firefox Desktop](http://www.mozilla.org/en-US/firefox/fx/#desktop).
2627

2728
<sub>Please [notify](https://github.com/jerone/UserScripts/issues/new?title=Userscript%20%3Cname%3E%20%28%3Cversion%3E%29%20also%20works%20in%20%3Cbrowser%3E%20on%20%3Cdesktop/device%3E) when this userscript is successfully tested in another browser...</sub>
2829

30+
### Version History
31+
32+
* **19**
33+
* Removed `GM_addStyle` as it gives errors in GreaseMonkey (not Scriptish);
34+
* Works with v1.1.57;
35+
* **19**
36+
* Clean up;
37+
* **18**
38+
* Changes for v1.1.37;
39+
2940
### Notes
3041

31-
Build for version 1.1.37
42+
Build for version 1.1.57
3243

3344
### External links
3445

0 commit comments

Comments
 (0)