Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghostery: 3.2.0 #1277

Merged
merged 16 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build Ghostery

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: macos-latest-xl
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup branding
run: sh Branding/setup.sh Ghostery ./
- name: Install Nodejs
uses: actions/setup-node@v3
with:
node-version-file: '.tool-versions'
cache: 'npm'
cache-dependency-path: ./package-lock.json
- name: Instal Node Modules
run: npm ci
- name: Build content scripts
run: npm run build-user-scripts
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup CocoaPods cache
uses: actions/cache@v2
id: cocoapods-cache
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Update Cocoapods
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
run: bundle exec pod install --repo-update
- name: Build
uses: sersoft-gmbh/xcodebuild-action@v2
with:
workspace: UserAgent.xcworkspace
scheme: Ghostery
configuration: CI
sdk: iphonesimulator
destination: platform=iOS Simulator,name=iPhone 14
action: build
output-formatter: 'bundle exec xcpretty'
1 change: 0 additions & 1 deletion .node-version

This file was deleted.

1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodejs 16.20.0
ruby 2.7.3
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "ghostery-wordmark-white (2).png",
"filename" : "ghostery-wordmark-white-1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ghostery-wordmark-white (3).png",
"filename" : "ghostery-wordmark-white-2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ghostery-wordmark-white (4).png",
"filename" : "ghostery-wordmark-white-3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Branding/Ghostery/Configuration/GhosteryAdHoc.xcconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Display name
BUNDLE_DISPLAY_NAME = Ghostery Dawn
BUNDLE_DISPLAY_NAME = Ghostery Private Browser

// Bundle Identifier
APP_BUNDLE_ID = com.ghostery.browser.nightly

// Marketing version
APP_MARKETING_VERSION = 3.1.1
APP_MARKETING_VERSION = 3.2.0

// URL Scheme
USER_AGENT_URL_SCHEME = GhosteryNightly
Expand Down
4 changes: 2 additions & 2 deletions Branding/Ghostery/Configuration/GhosteryDebug.xcconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Display name
BUNDLE_DISPLAY_NAME = Ghostery Dawn
BUNDLE_DISPLAY_NAME = Ghostery Private Browser

// Bundle Identifier
APP_BUNDLE_ID = com.ghostery.browser

// Marketing version
APP_MARKETING_VERSION = 3.1.1
APP_MARKETING_VERSION = 3.2.0

// URL Scheme
USER_AGENT_URL_SCHEME = GhosteryDebug
Expand Down
4 changes: 2 additions & 2 deletions Branding/Ghostery/Configuration/GhosteryRelease.xcconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Display name
BUNDLE_DISPLAY_NAME = Ghostery Dawn
BUNDLE_DISPLAY_NAME = Ghostery Private Browser

// Bundle Identifier
APP_BUNDLE_ID = com.evidon.Ghostery

// Marketing version
APP_MARKETING_VERSION = 3.1.1
APP_MARKETING_VERSION = 3.2.0

// URL Scheme
USER_AGENT_URL_SCHEME = Ghostery
Expand Down
2 changes: 0 additions & 2 deletions Branding/Ghostery/Entitlements/GhosteryAdHoc.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.web-browser</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.evidon.Ghostery.browser.nightly</string>
Expand Down
2 changes: 0 additions & 2 deletions Branding/Ghostery/Entitlements/GhosteryDebug.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.web-browser</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.ghostery.browser</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
Copyright © 2020 Cliqz. All rights reserved.
*/

"CFBundleDisplayName" = "In Ghostery Dawn öffnen";
"CFBundleDisplayName" = "In Ghostery Private Browser öffnen";
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
Copyright © 2020 Cliqz. All rights reserved.
*/

"CFBundleDisplayName" = "Open In Ghostery Dawn";
"CFBundleDisplayName" = "Open In Ghostery Private Browser";
6 changes: 3 additions & 3 deletions Branding/Ghostery/Siri/de.lproj/Intents.strings
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"3fYgNr" = "Suchanfrage";

"WogcPW" = "Suche mit Ghostery Dawn";
"WogcPW" = "Suche mit Ghostery Private Browser";

"ZrmRcJ" = "Wonach möchtest du suchen?";

"nChTLr" = "Mit Ghostery Dawn suchen";
"nChTLr" = "Mit Ghostery Private Browser suchen";

"uYCcdq" = "Suche mit Ghostery Dawn";
"uYCcdq" = "Suche mit Ghostery Private Browser";

6 changes: 3 additions & 3 deletions Branding/Ghostery/Siri/en.lproj/Intents.strings
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"3fYgNr" = "Query";

"WogcPW" = "Search With Ghostery Dawn";
"WogcPW" = "Search With Ghostery Private Browser";

"ZrmRcJ" = "What do you want to search?";

"nChTLr" = "Search query with Ghostery Dawn";
"nChTLr" = "Search query with Ghostery Private Browser";

"uYCcdq" = "Search With Ghostery Dawn";
"uYCcdq" = "Search With Ghostery Private Browser";

5 changes: 0 additions & 5 deletions Brewfile

This file was deleted.

2 changes: 1 addition & 1 deletion Client/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati
// readable from extensions, so they can just use the cached identifier.

SDWebImageDownloader.shared.setValue(firefoxUA, forHTTPHeaderField: "User-Agent")
//SDWebImage is setting accept headers that report we support webp. We don't
// SDWebImage is setting accept headers that report we support webp. We don't
SDWebImageDownloader.shared.setValue("image/*;q=0.8", forHTTPHeaderField: "Accept")

FaviconFetcher.userAgent = UserAgent.desktopUserAgent()
Expand Down
6 changes: 3 additions & 3 deletions Client/Application/NavigationRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ enum NavigationPath {

private static func handleHomePanel(panel: HomePanelPath, with bvc: BrowserViewController) {
switch panel {
case .bookmarks: break //Todo: #228 show bookmarks
case .history: break //Todo: #228 show history
case .downloads: break //Todo: #228 show downloads
case .bookmarks: break // Todo: #228 show bookmarks
case .history: break // Todo: #228 show history
case .downloads: break // Todo: #228 show downloads
case .topSites: bvc.openURLInNewTab(HomePanelType.topSites.internalUrl, isPrivileged: true)
case .newPrivateTab: bvc.openBlankNewTab(focusLocationField: false, isPrivate: true)
}
Expand Down
12 changes: 6 additions & 6 deletions Client/Assets/Search/SearchPlugins/ghostery-glow.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Client/DocumentServicesHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ protocol DocumentAnalyser {
}

struct LanguageDetector: DocumentAnalyser {
let name = "language" //This key matches the DerivedMetadata property
typealias NewMetadata = String //This matches the value for the DerivedMetadata key above
let name = "language" // This key matches the DerivedMetadata property
typealias NewMetadata = String // This matches the value for the DerivedMetadata key above

func analyse(metadata: PageMetadata) -> LanguageDetector.NewMetadata? {
if let metadataLanguage = metadata.language {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class BackForwardListViewController: UIViewController, UITableViewDataSource, UI
func homeAndNormalPagesOnly(_ bfList: WKBackForwardList) {
let items = bfList.forwardList.reversed() + [bfList.currentItem].compactMap({$0}) + bfList.backList.reversed()

//error url's are OK as they are used to populate history on session restore.
// error url's are OK as they are used to populate history on session restore.
listData = items.filter {
guard let internalUrl = InternalURL($0.url) else { return true }
if internalUrl.isAboutHomeURL {
Expand Down
4 changes: 2 additions & 2 deletions Client/Frontend/Browser/BrowserTrayAnimators.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private extension TrayToBrowserAnimator {
let displayedTabs = selectedTab.isPrivate ? tabManager.privateTabs : tabManager.normalTabs
guard let expandFromIndex = displayedTabs.firstIndex(of: selectedTab) else { return }

//Disable toolbar until animation completes
// Disable toolbar until animation completes
tabTray.toolbar.isUserInteractionEnabled = false

bvc.view.frame = transitionContext.finalFrame(for: bvc)
Expand Down Expand Up @@ -133,7 +133,7 @@ private extension BrowserToTrayAnimator {
let displayedTabs = selectedTab.isPrivate ? tabManager.privateTabs : tabManager.normalTabs
guard let scrollToIndex = displayedTabs.firstIndex(of: selectedTab) else { return }

//Disable toolbar until animation completes
// Disable toolbar until animation completes
tabTray.toolbar.isUserInteractionEnabled = false

tabTray.view.frame = transitionContext.finalFrame(for: tabTray)
Expand Down
8 changes: 4 additions & 4 deletions Client/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ class BrowserViewController: UIViewController {
}
let blurEffect = UIBlurEffect(style: .light)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
//always fill the view
// always fill the view
blurEffectView.frame = self.view.bounds
blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
self.view.addSubview(blurEffectView)
Expand Down Expand Up @@ -2065,7 +2065,7 @@ extension BrowserViewController: ContextMenuHelperDelegate {
let downloadAction = UIAlertAction(title: Strings.ContextMenu.DownloadLink, style: .default) { _ in
// This checks if download is a blob, if yes, begin blob download process
if !DownloadContentScript.requestBlobDownload(url: url, tab: currentTab) {
//if not a blob, set pendingDownloadWebView and load the request in the webview, which will trigger the WKWebView navigationResponse delegate function and eventually downloadHelper.open()
// if not a blob, set pendingDownloadWebView and load the request in the webview, which will trigger the WKWebView navigationResponse delegate function and eventually downloadHelper.open()
self.pendingDownloadWebView = currentTab.webView
let request = URLRequest(url: url)
currentTab.webView?.load(request)
Expand Down Expand Up @@ -2178,10 +2178,10 @@ extension BrowserViewController: ContextMenuHelperDelegate {
}
}

//Support for CMD+ Click on link to open in a new tab
// Support for CMD+ Click on link to open in a new tab
override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) {
super.pressesBegan(presses, with: event)
guard let key = presses.first?.key, (key.keyCode == .keyboardLeftGUI || key.keyCode == .keyboardRightGUI) else { return } //GUI buttons = CMD buttons on ipad/mac
guard let key = presses.first?.key, (key.keyCode == .keyboardLeftGUI || key.keyCode == .keyboardRightGUI) else { return } // GUI buttons = CMD buttons on ipad/mac
self.isCmdClickForNewTab = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ extension BrowserViewController: WKUIDelegate {
actions.append(UIAction(title: Strings.ContextMenu.DownloadLink, image: UIImage.templateImageNamed("menu-panel-Downloads"), identifier: UIAction.Identifier("linkContextMenu.download")) {_ in
// This checks if download is a blob, if yes, begin blob download process
if !DownloadContentScript.requestBlobDownload(url: url, tab: currentTab) {
//if not a blob, set pendingDownloadWebView and load the request in the webview, which will trigger the WKWebView navigationResponse delegate function and eventually downloadHelper.open()
// if not a blob, set pendingDownloadWebView and load the request in the webview, which will trigger the WKWebView navigationResponse delegate function and eventually downloadHelper.open()
self.pendingDownloadWebView = currentTab.webView
let request = URLRequest(url: url)
currentTab.webView?.load(request)
Expand Down
2 changes: 1 addition & 1 deletion Client/Frontend/Browser/Punycode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ private let tMin = 1
private let tMax = 26
private let initialBias = 72
private let initialN: Int = 128 // 0x80
private let delimiter: Character = "-"; // '\x2D'
private let delimiter: Character = "-" // '\x2D'
private let prefixPunycode = "xn--"
private let asciiPunycode = Array("abcdefghijklmnopqrstuvwxyz0123456789")

Expand Down
6 changes: 3 additions & 3 deletions Client/Frontend/Browser/ScreenshotHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ class ScreenshotHelper {
Sentry.shared.send(message: "Tab Snapshot Error", tag: .tabManager, severity: .debug, description: "Tab webView or url is nil")
return
}
//Handle home page snapshots, can not use Apple API snapshot function for this
// Handle home page snapshots, can not use Apple API snapshot function for this
if InternalURL(url)?.isAboutHomeURL ?? false {
if let homePanel = controller?.homeViewController {
let screenshot = homePanel.view.screenshot(quality: UIConstants.ActiveScreenshotQuality)
tab.setScreenshot(screenshot)
}
//Handle webview screenshots
// Handle webview screenshots
} else {
let configuration = WKSnapshotConfiguration()
//This is for a bug in certain iOS 13 versions, snapshots cannot be taken correctly without this boolean being set
// This is for a bug in certain iOS 13 versions, snapshots cannot be taken correctly without this boolean being set
if #available(iOS 13.0, *) {
configuration.afterScreenUpdates = false
}
Expand Down
4 changes: 2 additions & 2 deletions Client/Frontend/Browser/Tab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class Tab: NSObject {
return Strings.Menu.OpenHomePageTitleString
}

//lets double check the sessionData in case this is a non-restored new tab
// lets double check the sessionData in case this is a non-restored new tab
if let firstURL = sessionData?.urls.first, sessionData?.urls.count == 1, InternalURL(firstURL)?.isAboutHomeURL ?? false {
return Strings.Menu.OpenHomePageTitleString
}
Expand Down Expand Up @@ -731,7 +731,7 @@ class TabWebView: WKWebView, MenuHelperInterface {

/// Override evaluateJavascript - should not be called directly on TabWebViews any longer
// We should only be calling evaluateJavascriptInDefaultContentWorld in the future
@available(*, unavailable, message:"Do not call evaluateJavaScript directly on TabWebViews, should only be called on super class")
@available(*, unavailable, message: "Do not call evaluateJavaScript directly on TabWebViews, should only be called on super class")
override func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) {
super.evaluateJavaScript(javaScriptString, completionHandler: completionHandler)
}
Expand Down
2 changes: 1 addition & 1 deletion Client/Frontend/Browser/TabDisplayManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class TabDisplayManager: NSObject {
refreshStore()

if createTabOnEmptyPrivateMode {
//if private tabs is empty and we are transitioning to it add a tab
// if private tabs is empty and we are transitioning to it add a tab
if tabManager.privateTabs.isEmpty && isPrivate {
tabManager.addTab(isPrivate: true)
}
Expand Down
6 changes: 3 additions & 3 deletions Client/Frontend/Browser/TabManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ class TabManager: NSObject {
return profile.prefs.boolForKey("settings.closePrivateTabs") ?? false
}

//Called by other classes to signal that they are entering/exiting private mode
//This is called by TabTrayVC when the private mode button is pressed and BEFORE we've switched to the new mode
//we only want to remove all private tabs when leaving PBM and not when entering.
// Called by other classes to signal that they are entering/exiting private mode
// This is called by TabTrayVC when the private mode button is pressed and BEFORE we've switched to the new mode
// we only want to remove all private tabs when leaving PBM and not when entering.
func willSwitchTabMode(leavingPBM: Bool) {
recentlyClosedForUndo.removeAll()

Expand Down
6 changes: 3 additions & 3 deletions Client/Frontend/Browser/TabScrollController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,13 @@ extension TabScrollingController: UIScrollViewDelegate {
return
}

//scrollViewDidZoom will be called multiple times when a rotation happens.
// scrollViewDidZoom will be called multiple times when a rotation happens.
// In that case ALWAYS reset to the minimum zoom level if the previous state was zoomed out (isZoomedOut=true)
if isZoomedOut {
scrollView.zoomScale = scrollView.minimumZoomScale
} else if roundNum(scrollView.zoomScale) > roundNum(self.lastZoomedScale) && self.lastZoomedScale != 0 {
//When we have manually zoomed in we want to preserve that scale.
//But sometimes when we rotate a larger zoomScale is appled. In that case apply the lastZoomedScale
// When we have manually zoomed in we want to preserve that scale.
// But sometimes when we rotate a larger zoomScale is appled. In that case apply the lastZoomedScale
scrollView.zoomScale = self.lastZoomedScale
}
}
Expand Down
4 changes: 2 additions & 2 deletions Client/Frontend/Browser/TabTrayControllerV1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class TabTrayControllerV1: UIViewController {
}

override var preferredStatusBarStyle: UIStatusBarStyle {
//special case for iPad
// special case for iPad
if UIDevice.current.isPad {
return .default
}
Expand Down Expand Up @@ -238,7 +238,7 @@ class TabTrayControllerV1: UIViewController {
let toView: UIView
if !privateTabsAreEmpty(), let newSnapshot = collectionView.snapshotView(afterScreenUpdates: !exitingPrivateMode) {
emptyPrivateTabsView.isHidden = true
//when exiting private mode don't screenshot the collectionview (causes the UI to hang)
// when exiting private mode don't screenshot the collectionview (causes the UI to hang)
newSnapshot.frame = collectionView.frame
view.insertSubview(newSnapshot, aboveSubview: fromView)
collectionView.alpha = 0
Expand Down
2 changes: 1 addition & 1 deletion Client/Frontend/Browser/TopTabsLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TopTabsViewLayout: UICollectionViewFlowLayout {
var decorationAttributeArr: [Int: UICollectionViewLayoutAttributes?] = [:]
let separatorYOffset = TopTabsUX.SeparatorYOffset
let separatorSize = TopTabsUX.SeparatorHeight
let SeparatorZIndex = -2 ///Prevent the header/footer from appearing above the Tabs
let SeparatorZIndex = -2 /// Prevent the header/footer from appearing above the Tabs

override var collectionViewContentSize: CGSize {
let tabsWidth = ((CGFloat(collectionView!.numberOfItems(inSection: 0))) * (TopTabsUX.TabWidth + TopTabsUX.SeparatorWidth)) - TopTabsUX.SeparatorWidth
Expand Down
Loading
Loading