|
@@ -0,0 +1,27 @@
|
|
|
|
|
+import Foundation
|
|
|
|
|
+
|
|
|
|
|
+enum RedditAuthChromeStyle {
|
|
|
|
|
+ /// Hides Reddit auth modal close buttons in the embedded WebView.
|
|
|
|
|
+ static let injectionScript = """
|
|
|
|
|
+ (function() {
|
|
|
|
|
+ const STYLE_ID = 'reddora-auth-chrome-style';
|
|
|
|
|
+ if (document.getElementById(STYLE_ID)) return;
|
|
|
|
|
+
|
|
|
|
|
+ const style = document.createElement('style');
|
|
|
|
|
+ style.id = STYLE_ID;
|
|
|
|
|
+ style.textContent = `
|
|
|
|
|
+ auth-flow-modal button[aria-label="Close"],
|
|
|
|
|
+ auth-flow-modal button[aria-label="close"],
|
|
|
|
|
+ faceplate-modal button[aria-label="Close"],
|
|
|
|
|
+ shreddit-signup-drawer button[aria-label="Close"],
|
|
|
|
|
+ [role="dialog"] button[aria-label="Close"] {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ visibility: hidden !important;
|
|
|
|
|
+ pointer-events: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ `;
|
|
|
|
|
+
|
|
|
|
|
+ (document.head || document.documentElement).appendChild(style);
|
|
|
|
|
+ })();
|
|
|
|
|
+ """
|
|
|
|
|
+}
|