Skip to content

Commit

Permalink
Fix url redirect not supported on 12ft
Browse files Browse the repository at this point in the history
  • Loading branch information
And96 committed Jun 5, 2022
1 parent e80ef16 commit 91385ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
// 'document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });',
// 'window.localStorage.clear();',
// 'sessionStorage.clear();'
'if (!window.location.href.includes("12ft")) window.location.replace("https://12ft.io/" + window.location.href); '
'if ((!window.location.href.includes("12ft")) && (!window.location.href.includes("@"))) { window.location.replace("https://12ft.io/" + window.location.href)}; '
'if (window.location.href.includes("12ft") && window.location.href.includes("@")) { window.location.replace(window.location.href.replace("https://12ft.io/proxy?ref=&q=", "").replace("https://12ft.io/proxy?q=", "").replace("https://12ft.io/", "").replace("12ft.io/", ""))}; '
];
jsCode.forEach((String js) {
controller?.evaluateJavascript(source: js);
Expand Down Expand Up @@ -806,11 +807,11 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
webViewController?.loadUrl(
urlRequest: URLRequest(url: address));
}
removeElements(controller);
//removeElements(controller);
},
onLoadStop: (controller, url) async {
setState(() {
removeElements(controller);
// removeElements(controller);
});
},
onLoadStart: (controller, url) {
Expand Down Expand Up @@ -853,12 +854,18 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
/*onLoadError: (controller, url, code, message) {
},*/
onProgressChanged: (controller, progress) {
if (progress >= 95 && progress <= 97) {
/* if (progress >= 95 && progress <= 97) {
if (webViewController != null) {
removeElements(webViewController);
}
}
if (progress == 100) {
}*/
/* if (progress == 100) {
if (webViewController != null) {
removeElements(controller);
controller.clearCache();
}
}*/
if (progress == 30) {
if (webViewController != null) {
removeElements(controller);
controller.clearCache();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.2.0+1
version: 1.2.1+1

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down

0 comments on commit 91385ca

Please sign in to comment.