[~] Refactor
This commit is contained in:
parent
c1b7bb71b3
commit
4758032a35
80
deps/greasyfork/linkedin.user.js
vendored
80
deps/greasyfork/linkedin.user.js
vendored
@ -33,25 +33,25 @@ https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Polic
|
||||
|
||||
|
||||
{
|
||||
"request": [],
|
||||
"sendHeader": [],
|
||||
"receiveHeader": [
|
||||
{
|
||||
"enable": true,
|
||||
"name": "disable CSP for linkedin",
|
||||
"ruleType": "modifyReceiveHeader",
|
||||
"matchType": "domain",
|
||||
"pattern": "www.linkedin.com",
|
||||
"exclude": "",
|
||||
"group": "Ungrouped",
|
||||
"isFunction": false,
|
||||
"action": {
|
||||
"name": "content-security-policy",
|
||||
"value": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"receiveBody": []
|
||||
"request": [],
|
||||
"sendHeader": [],
|
||||
"receiveHeader": [
|
||||
{
|
||||
"enable": true,
|
||||
"name": "disable CSP for linkedin",
|
||||
"ruleType": "modifyReceiveHeader",
|
||||
"matchType": "domain",
|
||||
"pattern": "www.linkedin.com",
|
||||
"exclude": "",
|
||||
"group": "Ungrouped",
|
||||
"isFunction": false,
|
||||
"action": {
|
||||
"name": "content-security-policy",
|
||||
"value": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"receiveBody": []
|
||||
}
|
||||
*/
|
||||
|
||||
@ -206,12 +206,36 @@ div.online-fxreader-linkedin {
|
||||
GM_addElement('script', {
|
||||
"textContent": `
|
||||
class Linkedin {
|
||||
blah(class_name) {
|
||||
console.log('blah');
|
||||
Array.from(
|
||||
document.getElementsByClassName(class_name)
|
||||
).forEach((o) => o.remove());
|
||||
}
|
||||
constructor() {
|
||||
this.ui = {
|
||||
root: () => {
|
||||
return document.getElementsByClassName('online-fxreader-linkedin');
|
||||
},
|
||||
};
|
||||
|
||||
this.ui.search = () => {
|
||||
let search = this.ui.root().getElementsByClassName('.search')[0];
|
||||
let search_input = search.getElementsbyTagName('input')[0];
|
||||
return search_input;
|
||||
};
|
||||
}
|
||||
|
||||
blah(class_name) {
|
||||
console.log('blah');
|
||||
Array.from(
|
||||
document.getElementsByClassName(class_name)
|
||||
).forEach((o) => o.remove());
|
||||
}
|
||||
|
||||
search_on_change() {
|
||||
let self = this;
|
||||
let search = self.ui.search();
|
||||
search.setAttribute(
|
||||
'search',
|
||||
search.value
|
||||
);
|
||||
console.log(search.value);
|
||||
}
|
||||
};
|
||||
const online_fxreader_linkedin = new Linkedin();
|
||||
|
||||
@ -234,8 +258,8 @@ const online_fxreader_linkedin = new Linkedin();
|
||||
let search = $('<div>').addClass('search').append(
|
||||
$('<input>')
|
||||
).attr(
|
||||
'onchange',
|
||||
`function() {this.setAttribute('search', this.value); console.log(this.value);}`
|
||||
'onkeyup',
|
||||
`online_fxreader_linkedin.search_on_change()`,
|
||||
);
|
||||
self.ui.root.append(search);
|
||||
|
||||
@ -270,7 +294,7 @@ const online_fxreader_linkedin = new Linkedin();
|
||||
GM_addElement('script', {
|
||||
"class": 'bridge',
|
||||
"textContent": `
|
||||
online_fxreader_linkedin.blah('bridge');
|
||||
online_fxreader_linkedin.blah('bridge');
|
||||
`
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user