Size: 1899
Comment:
|
← Revision 10 as of 2019-10-23 22:44:39 ⇥
Size: 3787
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
The purpose of Greasemonkey is to manage user scripts. User scripts allow the user to control the way they use the web, by customizing it with scripting. The Greasemonkey extension won't do any good without any scripts installed. |
|
Line 5: | Line 8: |
* window is an XPCNativeWrapper of the content window. * document is the document object of the XPCNativeWrapper window object. |
|
Line 44: | Line 49: |
if( stringified_style != "{}"){ | //if( stringified_style != "{}"){ if( true ){ |
Line 53: | Line 59: |
document.getElementsByTagName("body")[0].style=""; | document.getElementsByTagName("body")[0].style="overflow: auto!important;"; var divs = document.getElementsByTagName("div"); for(var i=0; i< divs.length;i++){ var node = divs[i]; console.log(node.id); if(node.id.lastIndexOf("layer_gatting")>=0 ){ node.parentNode.removeChild( node); } } |
Line 58: | Line 74: |
window.setInterval( applyStuff , 300); | window.setInterval( applyStuff , 2000); |
Line 60: | Line 77: |
== Remove observador paywall == {{{#!highlight javascript // ==UserScript== // @name Remove observador paywall // @version 1.1 // @include * // ==/UserScript== // Remove observador paywall var divNode = document.createElement('div'); divNode.innerHTML = '<button id="removePaywall" type="button">Remove paywall</button>' divNode.setAttribute('id', 'buttonContainer'); divNode.setAttribute('style','position: fixed;left: 0;top: 50px;'); document.body.appendChild(divNode); //--- Activate the newly added button. document.getElementById ("removePaywall").addEventListener ("click", ButtonClickAction, false); function ButtonClickAction (zEvent) { if( window.location.href.lastIndexOf('observador.pt') >=0 ){ try{ document.title = "Applied " + new Date().toString(); var paywall = document.getElementById('paywall-block'); if(paywall!==null){ paywall.remove(); // remove paywall } var article = document.getElementsByClassName('article-body-wrapper'); article[0].style=""; // remove max height //alert('aaa'); } catch(ex){ document.title = "Error:" + ex.message; } } } }}} |
greasemonkey
The purpose of Greasemonkey is to manage user scripts. User scripts allow the user to control the way they use the web, by customizing it with scripting. The Greasemonkey extension won't do any good without any scripts installed.
- Any file that ends in .user.js is a user script.
- window is an XPCNativeWrapper of the content window.
- document is the document object of the XPCNativeWrapper window object.
Remove nonio popup
remove_nonio_popup.user.js
1 // ==UserScript==
2 // @name Remove Nonio Popup
3 // @author
4 // @namespace
5 // @homepage
6 // @description Remove nonio popup
7 // @version
8 // @supportURL
9 // @match https://*.aquelamaquina.pt/*
10 // @match https://*.xl.pt/*
11 // @match https://*.publico.pt/*
12 // @match https://*.sapo.pt/*
13 // @match https://*.blitz.pt/*
14 // @match https://*.visao.pt/*
15 // @match https://*.expressoemprego.pt/*
16 // @match https://*.cmjornal.pt/*
17 // @match https://*.record.pt/*
18 // @match https://*.jornaldenegocios.pt/*
19 // @match https://*.jn.pt/*
20 // @match https://*.dn.pt/*
21 // @match https://*.tsf.pt/*
22 // @match https://*.sabado.pt/*
23 // @match https://*.ojogo.pt/*
24 // @match https://*.dinheirovivo.pt/*
25 // @match https://*.iol.pt/*
26 // @match https://*.flash.pt/*
27 // @match https://*.vidas.pt/*
28 // @match https://*.maxima.pt/*
29 // @grant none
30 // ==/UserScript==
31
32 function applyStuff(){
33 //console.log("Is ready");
34 var stringified_style = JSON.stringify(document.getElementsByTagName("body")[0].style );
35
36 //if( stringified_style != "{}"){
37 if( true ){
38 console.log("Applied stuff");
39 console.log( stringified_style );
40 var element = document.getElementsByTagName("iframe");
41 var index;
42
43 for (index = element.length - 1; index >= 0; index--) {
44 element[index].parentNode.removeChild(element[index]);
45 }
46 document.getElementsByTagName("body")[0].style="overflow: auto!important;";
47
48 var divs = document.getElementsByTagName("div");
49
50 for(var i=0; i< divs.length;i++){
51 var node = divs[i];
52 console.log(node.id);
53 if(node.id.lastIndexOf("layer_gatting")>=0 ){
54 node.parentNode.removeChild( node);
55 }
56 }
57 }
58 }
59
60 // call each second
61 window.setInterval( applyStuff , 2000);
Remove observador paywall
1 // ==UserScript==
2 // @name Remove observador paywall
3 // @version 1.1
4 // @include *
5 // ==/UserScript==
6 // Remove observador paywall
7 var divNode = document.createElement('div');
8 divNode.innerHTML = '<button id="removePaywall" type="button">Remove paywall</button>'
9 divNode.setAttribute('id', 'buttonContainer');
10 divNode.setAttribute('style','position: fixed;left: 0;top: 50px;');
11 document.body.appendChild(divNode);
12
13 //--- Activate the newly added button.
14 document.getElementById ("removePaywall").addEventListener ("click", ButtonClickAction, false);
15
16 function ButtonClickAction (zEvent) {
17 if( window.location.href.lastIndexOf('observador.pt') >=0 ){
18 try{
19 document.title = "Applied " + new Date().toString();
20 var paywall = document.getElementById('paywall-block');
21 if(paywall!==null){
22 paywall.remove(); // remove paywall
23 }
24 var article = document.getElementsByClassName('article-body-wrapper');
25 article[0].style=""; // remove max height
26 //alert('aaa');
27 }
28 catch(ex){
29 document.title = "Error:" + ex.message;
30 }
31 }
32
33 }