-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcareers-mutateButton.js
50 lines (43 loc) · 1.58 KB
/
careers-mutateButton.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
const StartWatchingIndeedButton = (target) => {
// Mutation function
const ChangeIndeedButtonFunc = () => {
// Add our own class in
$('.indeed-apply-widget').addClass('apply-careers');
// $('.apply-careers').attr('style', 'background: none !important; box-shadow: none !important');
// Remove background color and shadow
$('.indeed-apply-button').attr(
'style',
'background: none !important;'
+ 'box-shadow: none !important;'
+ 'padding: 5px 20px !important;'
+ 'display: inline-block;',
);
// Remove indeed logo
$('.indeed-apply-button .indeed-apply-button-inner-left').attr('style', 'display: none !important');
// Edit internal button
$('.indeed-apply-button .indeed-apply-button-inner').attr(
'style',
'background: unset !important;'
+ 'color: #203542 !important;'
+ 'padding: 0px !important;'
+ 'font: unset !important;'
+ 'text-shadow: none !important;'
+ 'display: flex !important;'
+ 'float: none !important;'
+ 'align-items: center !important',
);
};
if ($('.indeed-apply-button .indeed-apply-button-inner-left').length > 0) {
ChangeIndeedButtonFunc();
}
// create an observer instance
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
setTimeout(ChangeIndeedButtonFunc, 0);
});
});
// configuration of the observer:
const config = { attributes: true, childList: true, characterData: true }
// pass in the target node, as well as the observer options
observer.observe(target, config);
};