mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-06-04 02:34:07 +02:00
Fix twitter login page after it was migrated and broke detection
This commit is contained in:
parent
418388b0ab
commit
cf7029037e
Resources/Scripts
@ -68,22 +68,13 @@ button[type='submit'] {
|
|||||||
/* General per-page styling */
|
/* General per-page styling */
|
||||||
/****************************/
|
/****************************/
|
||||||
|
|
||||||
html[mobile][login] div[tweetduck-login-wrapper] {
|
html[login] div[tweetduck-login-wrapper] {
|
||||||
/* vertically center page & fix colors */
|
/* vertically center page & fix colors */
|
||||||
margin-top: calc(50vh - 200px);
|
margin-top: calc(50vh - 200px);
|
||||||
padding: 26px 1.1vw;
|
padding: 26px 1.1vw;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[mobile][login] #tweetduck-helper:hover {
|
html[login] #tweetduck-helper:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[desktop][login] #tweetduck-helper {
|
|
||||||
margin-top: 15px !important;
|
|
||||||
font-weight: bold !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
html[mobile][logout] div[role="button"] {
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.3) !important;
|
|
||||||
}
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
(function(){
|
(function(){
|
||||||
const isLogin = location.pathname === "/login";
|
const isLogin = location.pathname === "/login";
|
||||||
const isLogout = location.pathname === "/logout";
|
const isLogout = location.pathname === "/logout";
|
||||||
const isMobile = location.host === "mobile.twitter.com";
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Function: Inject custom CSS into the page.
|
// Function: Inject custom CSS into the page.
|
||||||
@ -24,13 +23,6 @@
|
|||||||
else if (isLogout){
|
else if (isLogout){
|
||||||
document.documentElement.setAttribute("logout", "");
|
document.documentElement.setAttribute("logout", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMobile){
|
|
||||||
document.documentElement.setAttribute("mobile", "");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
document.documentElement.setAttribute("desktop", "");
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
setTimeout(injectCSS, 1);
|
setTimeout(injectCSS, 1);
|
||||||
@ -53,7 +45,6 @@
|
|||||||
//
|
//
|
||||||
if (isLogin){
|
if (isLogin){
|
||||||
document.addEventListener("DOMContentLoaded", function(){
|
document.addEventListener("DOMContentLoaded", function(){
|
||||||
if (isMobile){
|
|
||||||
triggerWhenExists("main h1", function(heading){
|
triggerWhenExists("main h1", function(heading){
|
||||||
heading.parentNode.setAttribute("tweetduck-login-wrapper", "");
|
heading.parentNode.setAttribute("tweetduck-login-wrapper", "");
|
||||||
return true;
|
return true;
|
||||||
@ -86,37 +77,12 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
else{
|
|
||||||
const openLinkExternally = function(e){
|
|
||||||
let href = e.currentTarget.getAttribute("href");
|
|
||||||
$TD.openBrowser(href[0] === '/' ? location.origin+href : href);
|
|
||||||
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
};
|
|
||||||
|
|
||||||
for(let link of document.getElementsByTagName("A")){
|
|
||||||
link.addEventListener("click", openLinkExternally);
|
|
||||||
}
|
|
||||||
|
|
||||||
let texts = document.querySelector(".page-canvas > div:last-child");
|
|
||||||
|
|
||||||
if (texts){
|
|
||||||
texts.insertAdjacentHTML("beforeend", `<p id="tweetduck-helper">Used the TweetDuck app before? <a href="#">Import your profile »</a></p>`);
|
|
||||||
|
|
||||||
texts.querySelector("#tweetduck-helper > a").addEventListener("click", function(){
|
|
||||||
$TD.openProfileImport();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Block: Hide cookie crap.
|
// Block: Hide cookie crap.
|
||||||
//
|
//
|
||||||
if (isMobile){
|
|
||||||
document.addEventListener("DOMContentLoaded", function(){
|
document.addEventListener("DOMContentLoaded", function(){
|
||||||
triggerWhenExists("a[href^='https://help.twitter.com/rules-and-policies/twitter-cookies']", function(cookie){
|
triggerWhenExists("a[href^='https://help.twitter.com/rules-and-policies/twitter-cookies']", function(cookie){
|
||||||
while(!!cookie){
|
while(!!cookie){
|
||||||
@ -132,5 +98,4 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
})();
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user