-
Notifications
You must be signed in to change notification settings - Fork 0
/
Prevent Public Links.user.js
68 lines (61 loc) · 1.75 KB
/
Prevent Public Links.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// ==UserScript==
// @name Prevent Public Links
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Remove NOC "Closed" Button
// @author Connor Kaiser
// @include https://osisoft--fullcopy.*
// @include https://osisoft--prodcopy.*
// @include https://osisoft.lightning.force.*
// @grant none
// ==/UserScript==
(function()
{
if (window.top === window.self)
{
var SendButtonCount = 0;
var observer = new MutationObserver(function(mutations)
{
var Sendbuttons = document.getElementsByClassName("slds-button slds-button--brand cuf-publisherShareButton MEDIUM uiButton")
if (Sendbuttons != null && Sendbuttons.length != SendButtonCount)
{
SendButtonCount = Sendbuttons.length;
}
else
{
return;
}
//Code
for(let i=0;i<Sendbuttons.length;i++)
{
Sendbuttons[i].addEventListener("click",LinkRedirect, true);
Sendbuttons[i].style.paddingLeft = "0rem"
Sendbuttons[i].style.paddingRight = "0rem"
Sendbuttons[i].style.borderWidth = "0px"
}
});
observer.observe(document, {
childList: true,
subtree: true
});
return;
}
else
{
return;
}
})();
function LinkRedirect(event)
{
var TextBox = document.getElementById("editor_rta_body")
if (TextBox.innerHTML.match("osisoft.lightning.force.com").index > -1)
{
event.preventDefault();
event.stopPropagation();
return false
}
else
{
return false
}
}