kyzmitch / cotton Goto Github PK
View Code? Open in Web Editor NEWweb browser for iOS/Android with DNS over HTTPS and file downloader
License: Other
web browser for iOS/Android with DNS over HTTPS and file downloader
License: Other
checked on iPhone 8 simulator and iPhone x , xs with iOS 12.x and no any constraint errors in logs. Only on iOS 13.
Probably something bad with SnapKit, will try to remove this dependency and actually it's not under support since 2019, only some fresh Issues on github, but without pull requests.
Resubscribtion for web view isn't implemented yet
when user selects another tab with web site and then goes back to previous tab with another site
fileprivate extension MasterRouter {
func showTabMenuIfNeeded(from sourceView: UIView,
and sourceRect: CGRect,
menuStyle: MenuModelStyle) {
// ios less than 13.0
// isPad is false
else {
// FIXME: this causes layout error for some reason
presenter.viewController.present(alert, animated: true)
}
In HttpClient+RxSwift.swift
and in HttpClient+Combine.swift
the makeRequest
or makeRxRequest
are happening on the same calling thread. Sometimes it is a UI thread, and sometimes it is a Search thread created on view layer.
It would be good to use some separate DispatchQueue defined in specific HttpClient instance.
But it is not critical, because actually the main network code is executed on a Thread created by a 3rd party Networking framework (Alamofire).
back and forward buttons are not active in Phone layout if UIKit mode is selected (with Async await concurrency mode) and user selects internal web site link and then some other link which should go to the different web site, but both times back button is gray and not active.
Scenario:
Observed results: address still be the same without specifying concrete video address
First found on when I worked on Developer menu #24
but it is reproducible also for old existing menus like Default Content Type for tab. So, it means it is on develop/master branch as well.
Tested that on iPhone 8 with iOS 13.x it works perfectly. Even new dev menu.
can be done starting from Swift 5.9
Some existing classes has a lot of dependencies e.g. BrowserContentView
, need to leverage service locator pattern or implement DI.
In the new PR #72 which is not finished yet I had to create service locator to access the use cases, but need to improve it even more.
Make sure to use ServiceLocator only inside UseCaseFactory or other factories.
Tried to build make build-ios-dev-release
on fresh macOS installation with Xcode 15 using make command, but it failed with following errors:
output:
-macosx_version_min has been renamed to -macos_version_min
ld: unknown options: -sdk_version
> Task :linkReleaseFrameworkMacosX64 FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':linkReleaseFrameworkMacosX64'.
/bin/bash: swiftlint: command not found
Due to web view reuse feature, each wkwebview not destroyed after tab closing, so, that is why user can continue hear audio from the video on closed tab.
Found on actors branch, decided to merge it to main branch anyway
Need to fix them after removing a lot of dependencies from it. It includes some tests which are still using Alamofire to create the objects for the tests results verification
preconditions:
Probably something connected with keyboard based layout changes
Currently it could be triggered by pull request, but for some reason it can't find swift files to check:
Run norio-nomura/[email protected]
env:
DIFF_BASE: master
...
"/home/runner/work/Cotton/Cotton":"/github/workspace" 5bedb4:05ddb88e99204900a5dd037a6155f6a8
fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:
git config --global --add safe.directory /github/workspace
error: Could not access 'FETCH_HEAD'
No Swift file changed
taps on tab view are working, but it seems need to finish this implementation to make it fully correct.
just after releasing beta found out that it's not possible to open new blank tab on iPhone at least.
Even if selected tab content is the same and tabs observer filter out possible duplicates to not notify about the same data, turns out that it is still possible to be notified with the same object more than once.
SmartphoneSearchBarViewController
is a subscriber of TabsObserver
tabDidSelect
and it updates the view state accordingly, but AppCoordinator
is also needs to be subscribed to do some different handling for different views and the issue is that it also asks SmartphoneSearchBarViewController
again to update the view state.
When new tab is added (usually at the end of the list - right side) user could have tab selected in the beginning of the list and there are a lot of other tabs, so, we're scrolling tab views to show the last one which was added/selected automatically. This works, but it seems need to finish some corner cases.
Xcode 13.0 beta ?
final class WebViewsReuseManager {
private init(_ viewsLimit: Int = 10) {
assert(viewsLimit >= 1, "Not possible view limit")
views = [WebViewController]() <----
env:
iPhone simulator 12.4 iphone xs, master
branch (not! feature/visual_state_tab_property_refactor)
steps:
Works fine on Xcode 12.5 with same iphone xs
#10 0x000000010f7060eb in WebViewsReuseManager.init(_:) at /Users/aermoshin/prj/catowser/catowser/catowser/WebSite/WebViewsReuseManager.swift:29
#11 0x000000010f705f84 in WebViewsReuseManager.__allocating_init(_:) ()
#12 0x000000010f705f30 in one-time initialization function for shared at /Users/aermoshin/prj/catowser/catowser/catowser/WebSite/WebViewsReuseManager.swift:16
#13 0x00000001155cadb5 in _dispatch_client_callout ()
#14 0x00000001155cc83c in _dispatch_once_callout ()
#15 0x0000000113b1a579 in swift_once ()
#16 0x000000010f705fc1 in WebViewsReuseManager.shared.unsafeMutableAddressor at /Users/aermoshin/prj/catowser/catowser/catowser/WebSite/WebViewsReuseManager.swift:16
#17 0x000000010f73d2f1 in MasterBrowserViewController.openSiteTabContent(with:) at /Users/aermoshin/prj/catowser/catowser/catowser/Browser/MasterBrowserViewController.swift:387
#18 0x000000010f73cffa in MasterBrowserViewController.open(tabContent:) at /Users/aermoshin/prj/catowser/catowser/catowser/Browser/MasterBrowserViewController.swift:369
#19 0x000000010f73fe8c in MasterBrowserViewController.didSelect(index:content:) at /Users/aermoshin/prj/catowser/catowser/catowser/Browser/MasterBrowserViewController.swift:519
To reproduce use iPhone 14 pro max and iPad Pro which have Regular size classes
https://github.com/kyzmitch/CatowserEvolution/blob/master/0039-size-classes-portrait-mode.md
Use MainActor for iOS client view models and custom actors for other stuff
See:
Wasn't able to find how to handle task cancellation for Combine Publishers. This is needed for HttpKit code to finish implementation.
When tab content - web site loading takes too long, e.g. youtube video, and after switching to blank tab with top sites. It is still shows web site loading progress bar (not finished like 80%) and after some time it loads web view to this blank tab which is completely unexpected, because top sites view still should stay.
Concurrency API worked for web search autocomplete, but now with View Model it needs to be revisited.
probably on view model impl level it should look like:
@Published var aaState: SearchSuggestionsViewState = .waitingForQuery
The only issue is it is better to use something similar to @Published
property wrapper from SwiftUI. It is because actually SwiftUI is not needed here because old UIKit views are used currently. And another thing is that property wrappers can't be used in Swift protocols and swift protocol for ViewModel is used.
Found on master branch, opened one top site and then created 2nd tab where was an attempt to open top site, but it wasn't possible. No any error or debug logs in console.
To be able to store these instances in the hash table or other hash based collection need need to have such a function, but it could be improved most likely.
public func hash(into hasher: inout Hasher) {
/// TODO: could use UUID for each `ResponseHandlingApi` to simplify this
let caseNumber: Int
switch self {
case .closure(let closureWrapper):
caseNumber = 0
hasher.combine(closureWrapper)
case .rxObserver(let observerWrapper):
caseNumber = 1
hasher.combine(observerWrapper)
case .waitsForRxObserver:
caseNumber = 2
case .waitsForCombinePromise:
caseNumber = 3
case .combine(let promiseWrapper):
caseNumber = 4
hasher.combine(promiseWrapper)
case .asyncAwaitConcurrency:
caseNumber = 5
}
hasher.combine(caseNumber)
}
It seems I can't fix it without using background tasks, Alamofire doesn't implement them
https://forums.developer.apple.com/thread/85066
download error: network error: Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={_NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <A429C574-5C04-47FA-B065-A9282A2D22BF>.<1>, _kCFStreamErrorDomainKey=1, NSErrorPeerAddressKey=<CFData 0x2838c9360 [0x1d8b51420]>{length = 16, capacity = 16, bytes = 0x100201bb804beb2c0000000000000000}, _kCFStreamErrorCodeKey=53, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDownloadTask <A429C574-5C04-47FA-B065-A9282A2D22BF>.<1>" )}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.