DuckDuckGo iOS Application

Overview

DuckDuckGo iOS

We are excited to engage the community in development!

We are hiring!

DuckDuckGo is growing fast and we continue to expand our fully distributed team. We embrace diverse perspectives, and seek out passionate, self-motivated people, committed to our shared vision of raising the standard of trust online. If you are a senior software engineer capable in either iOS or Android, visit our careers page to find out more about our openings!

Building

Submodules

We use submodules, so you will need to bring them into the project in order to build and run it:

Run git submodule update --init --recursive

Developer details

If you're not part of the DuckDuckGo team, you should provide your Apple developer account id, app id, and group id prefix in an ExternalDeveloper.xcconfig file. To do that:

  1. Run cp Configuration/DuckDuckGoDeveloper.xcconfig Configuration/ExternalDeveloper.xcconfig
  2. Edit Configuration/ExternalDeveloper.xcconfig and change the values of all fields
  3. Clean and rebuild the project

Dependencies

We use Swift Package Manager for dependency management, which shouldn't require any additional set up.

SwiftLint

We use SwifLint for enforcing Swift style and conventions, so you'll need to install it.

Fonts

We use Proxima Nova fonts which are proprietary and cannot be committed to source control, see fonts.

Debugging

Instruments

We have Custom Instruments tool to help visualize and track events that happen during runtime.

In order to run it:

  1. Build a Debug version and install it on Simulator/Device.
  2. Select Instruments target and run it on a Mac. A New instance of Instruments app will be run that has a grayed out icon indicating that it works in debug mode with custom instruments attached.
  3. Select 'DDG Trace' template or set up a custom one by importing 'DDG Timeline' instrument from Library.
  4. Start recording.

See Instruments Developer Help for reference how to create custom instruments.

Terminology

We have taken steps to update our terminology and remove words with problematic racial connotations, most notably the change to main branches, allow lists, and blocklists. Closed issues or PRs may contain deprecated terminology that should not be used going forward.

Contribute

Please refer to contributing.

Discuss

Contact us at https://duckduckgo.com/feedback if you have feedback, questions or want to chat. You can also use the feedback form embedded within our Mobile App - to do so please navigate to Settings and select "Send Feedback".

License

DuckDuckGo is distributed under the Apache 2.0 license.

Comments
  • Automatically clear data breaks app on change app

    Automatically clear data breaks app on change app

    Steps to reproduce:

    1. Turn on Automatically clear data. Any settings. I've tried multiple configs, but I specifically had "Clear Tabs and Data" and "App Exit, Inactive for 1 hour".
    2. Change app. Don't bother navigating to a web page. It's not necessary.
    3. Change back. The app is not functional. Address bar is usable, but attempts to navigate the web fail. All buttons stop functioning; although, the UI continues to work, meaning buttons blink as they should when pressed, but no menus appear.

    PS: I'm loving this app.

    Work In Progress 
    opened by rwdj 22
  • Make team id, app id and a group prefix specifiable in an xcconfig

    Make team id, app id and a group prefix specifiable in an xcconfig

    Task/Issue URL: Issue #479 Tech Design URL: - CC: @brindy @bwaresiak

    Description:

    To make it easier for external developers to contribute, this PR takes out team id, app id and group prefix out of the project file / entitlements files. Instead, they are specified in an xcconfig file at Configuration/Developer.xcconfig which is kept out of version control.

    For developers who are part of the DuckDuckGo team, the Configuration/Developer.xcconfig should have the following content:

    DEVELOPMENT_TEAM = HKE973VLUW
    APP_ID = com.duckduckgo.mobile.ios
    GROUP_ID_PREFIX = group.com.duckduckgo
    

    To enable the group ids need to be accessed from code, the group id prefix is added to the Info.plists as necessary, so that the prefix can be obtained by examining the bundle in code.

    For this, Core/global.swift now defines a struct Global. Having a Global defined inside a global.swift doesn't look very good. I think we should rename it to Global.swift and bring isDebugBuild into struct Global, but that should probably be done outside of this PR. What do you think?

    Steps to test this PR:

    1. If you're part of the DuckDuckGo team, create a Configuration/Developer.xcconfig as specified above

    2. Build and run the project as before

    3. Make sure the app and extensions work normally

      There are 3 app groups here:

      1. Bookmarks (Used by app, bookmarks widget)
      2. Content Blocker (Used by app only)
      3. Statistics (Used by app, bookmarks widget, quick actions widget)

      So we should test these combinations:

      1. Test that bookmarks work from both the app and the bookmarks widget.
      2. Test that atb statistics are correctly handled from the app, the bookmarks widget and the quick actions widget (I don't know how to test this)

    Internal references:

    Software Engineering Expectations Technical Design Template

    opened by roop 22
  • [Feature Request] Adding bookmarklet support

    [Feature Request] Adding bookmarklet support

    Hi. is it possible to add bookmarklet support? Currently, when adding a bookmarklet, it will always prefix http://, I'm not a real coder but perhaps there should be something in this file

    https://github.com/duckduckgo/iOS/blob/develop/DuckDuckGo/EditBookmarkAlert.swift

    at line 83

    where current code is

    if !urlString.hasPrefix("http://") && !urlString.hasPrefix("https://") {
                    urlString = "http://\(urlString)"
                }
    

    So we can replace with something like

    if !urlString.hasPrefix("javascript:") {
                    urlString = "javascript:\(urlString)"
                } else if !urlString.hasPrefix("http://") && !urlString.hasPrefix("https://") {
                    urlString = "http://\(urlString)"
                }
    

    Or however it's done... Thanks

    opened by wolnavi 19
  • Safe area not covered at the bottom on

    Safe area not covered at the bottom on "Find in Page"

    App version: 7.45.0.0

    Device model: iPhone 11 Pro

    iOS version: iOS 13.4.1

    Steps to reproduce the bug:

    • Go to find "Find in Page"
    • Search something
    • Scroll down, or hide keyboard (on iPad Pro)

    Expected behavior: You cannot see the website content behind the home indicator/safe area

    Actual behavior: You can see the website content behind the home indicator/safe area

    IMG_DBC9AADD7F58-1

    Hacktoberfest 
    opened by Lascorbe 11
  • Autofill Settings layout improvements for landscape / iPad

    Autofill Settings layout improvements for landscape / iPad

    Task/Issue URL: https://app.asana.com/0/72649045549333/1202809065048067/f Tech Design URL: CC:

    Description: Landscape and iPad layout handling for all screens associated with Autofill Settings including:

    • locked view
    • empty autofill view (enabled and disabled states)
    • list view with items and
    • empty search results

    Steps to test this PR:

    1. Run through the different view states confirming the layouts match designs for iPhone landscape and iPad portrait & landscape
    2. Confirm iPhone portrait layouts are still correct

    Copy Testing:

    • [ ] Use of correct apostrophes in new copy, ie rather than '

    Orientation Testing:

    • [ ] Portrait
    • [ ] Landscape

    Device Testing:

    • [ ] iPhone SE (1st Gen)
    • [ ] iPhone 8
    • [ ] iPhone X
    • [ ] iPad

    OS Testing:

    • [ ] iOS 14
    • [ ] iOS 15

    Theme Testing:

    • [ ] Light theme
    • [ ] Dark theme

    Internal references:

    Software Engineering Expectations Technical Design Template When ready for review, remember to post the PR in MM

    opened by amddg44 10
  • Make AppDeepLinks quick link detection methods not case sensitive.

    Make AppDeepLinks quick link detection methods not case sensitive.

    Reviewer: Asana: CC:

    Description: This pull request resolves an issue I found when trying to integrate DuckDuckGo into my app Opener, which relies on URL schemes to work with other apps. I was pleased to find DuckDuckGo was open source so I could diagnose and resolve the issue 😊.

    Here's a video of what I was seeing (also demos the testing steps) https://db.tt/ISduGbXZOv

    Steps to test this PR:

    1. Install and launch DuckDuckGo.
    2. Launch Safari.
    3. Enter the URL ddgQuickLink://apple.com and press the 'Go' key.
    4. See that DuckDuckGo launches and navigates to apple.com.

    Prior to this PR the iOS normalization of URL schemes to lowercase caused this link detection to not work, so the app would launch but not navigate to the correct URL.

    Reviewer Checklist:
    • [ ] Ensure the PR solves the problem
    • [ ] Review every line of code
    • [ ] Ensure the PR does no harm by testing the changes thoroughly
    • [ ] Get help if you're uncomfortable with any of the above!
    • [ ] Determine if there are any quick wins that improve the implementation
    PR DRI Checklist:
    • [x] Get advice or leverage existing code
    • [ ] Agree on technical approach with reviewer (if the changes are nuanced)
    • [x] Ensure that there is a testing strategy (and documented non-automated tests)
    • [ ] Ensure there is a documented monitoring strategy (if necessary)
    • [ ] Consider systems implications (Database connections, Grafana stats, CPU)
    opened by timonus 10
  • app version number in system settings

    app version number in system settings

    opened by Recouse 9
  • Desktop site feature loads mobile layout

    Desktop site feature loads mobile layout

    This is the equivalent of https://github.com/duckduckgo/Android/issues/768. I'm opening this against the iOS app as well because I was able to demonstrate a potential fix in the iOS code (see below).

    Some sites with a responsive layout look the same regardless of whether the desktop site was requested. This can be a problem when certain features are hidden on smaller screens which makes the "request desktop site" feature less useful in those case.

    One example is stackoverflow.com.

    This is default layout:

    Simulator Screen Shot - iPhone 11 Pro Max - 2020-04-16 at 22 09 03

    This is the layout after requesting the desktop site:

    Simulator Screen Shot - iPhone 11 Pro Max - 2020-04-16 at 22 09 11

    Both look the same because the page uses a responsive design.

    This doesn't happen on the Firefox Android app and, as mentioned in https://github.com/duckduckgo/Android/issues/768#issuecomment-614755040, Firefox appears to be forcing a desktop viewport (980px wide) when the desktop site is requested.

    In the Firefox app, this switch is made inside the layout engine itself (see here). For the DuckDuckGo iOS app, I think it might be possible to achieve the same by forcing a desktop viewport via a user script.

    The diff below is a quick hack to demonstrate what I mean:

    diff --git a/DuckDuckGo/TabViewController.swift b/DuckDuckGo/TabViewController.swift
    index 4f166fa..922ef4b 100644
    --- a/DuckDuckGo/TabViewController.swift
    +++ b/DuckDuckGo/TabViewController.swift
    @@ -364,6 +364,25 @@ class TabViewController: UIViewController {
             if #available(iOS 13, *) {
                 webView.configuration.defaultWebpagePreferences.preferredContentMode = tabModel.isDesktop ? .desktop : .mobile
             }
    +
    +        reloadScripts()
    +
    +        if tabModel.isDesktop {
    +            webView.configuration.userContentController.addUserScript(WKUserScript(
    +                source: """
    +                    let content = 'width=980px';
    +                    let viewport = document.querySelector('meta[name=viewport]');
    +                    if (viewport) {
    +                        viewport.content = content;
    +                    } else {
    +                        viewport = document.createElement('meta');
    +                        viewport.name = 'viewport';
    +                        viewport.content = content;
    +                        document.getElementsByTagName('head')[0].appendChild(viewport);
    +                    }
    +                    """,
    +                injectionTime: .atDocumentEnd, forMainFrameOnly: true))
    +        }
         }
    

    With this in place stackoverflow.com loads in a desktop-like layout:

    Simulator Screen Shot - iPhone 11 Pro Max - 2020-04-16 at 22 09 43

    I haven't evaluated the potentially broader implications of such a user script but I wanted to share my findings to put this up for discussion.

    opened by Johennes 8
  • [Xcode] adds script for updating Settings bundle

    [Xcode] adds script for updating Settings bundle

    duckduckgo-settings


    Task/Issue URL: #497

    Description: This adds:

    1. a config file that defines MARKETING_VERSIONVersion.xcconfig;
    2. a settings bundle–Settings.bundle;
    3. a script file–set_version.sh.

    The script file pulls MARKETING_VERSION from the config file, and writes it to the settings bundle.

    Steps to test this PR:

    1. Run chmod +x set_version.sh to ensure it is executable;
    2. Run set_version.sh 7.33.1

    Known Issues: This script should be run prior to build the app for a release, and the resulting changes committed.


    Internal references:

    Software Engineering Expectations Technical Design Template

    opened by KevinVitale 8
  • New feature: Downloading files

    New feature: Downloading files

    Hello folks. I want to add Downloading files feature to this project. In example: downloading epub files, zip etc. So what do you think about it?

    Expected behavior:

    The app should download epub file, then shows it in Books app.

    Actual behavior:

    The app opens a page that shows the unicode.

    opened by ilyarmnzhdn 8
  • Tab restoration does not restore the tab history

    Tab restoration does not restore the tab history

    When restoring a tab from disk, only the current page is restored. The tab’s back-forward history is lost.

    App version: 7.25.0.0 Device model: iPhone SE iOS version: 12.4.1

    Steps to reproduce the bug:

    1. Open a new tab
    2. Go to a page (say, a DuckDuckGo search)
    3. Tap on a link (say, the first result)
    4. Wait for the page to finish loading
    5. Force-close the DuckDuckGo app
    6. Reopen the DuckDuckGo app

    Expected behavior:

    • The app should open with a tab that allows one to go back (say, to the DuckDuckGo search)

    Actual behavior:

    • The app opens with a tab that shows the last seen page, but doesn’t allow one to go back or forward

    If you think this is worth doing, I'd be happy to discuss an implementation strategy and work on a PR for this.

    opened by roop 8
  • CoreGraphics create_protected_copy crash fix attempt

    CoreGraphics create_protected_copy crash fix attempt

    Task/Issue URL: https://app.asana.com/0/414709148257752/1203075050360165/f Tech Design URL: CC:

    Description: Attempt to fix crash by removing a force unwrap

    Steps to test this PR:

    1. Visit a webpage with js alerts e.g. https://privacy-test-pages.glitch.me/features/js-alerts.html
    2. With a js alert tab showing, tap the tab switcher and confirm the js alert is snapshotted and displayed correctly in the tab preview

    Copy Testing:

    • [ ] Use of correct apostrophes in new copy, ie rather than '

    Orientation Testing:

    • [ ] Portrait
    • [ ] Landscape

    Device Testing:

    • [ ] iPhone SE (1st Gen)
    • [ ] iPhone 8
    • [ ] iPhone X
    • [ ] iPhone 14 Pro
    • [ ] iPad

    OS Testing:

    • [ ] iOS 14
    • [ ] iOS 15
    • [ ] iOS 16

    Theme Testing:

    • [ ] Light theme
    • [ ] Dark theme

    Internal references:

    Software Engineering Expectations Technical Design Template When ready for review, remember to post the PR in MM

    opened by amddg44 0
  • Autofill Logins Auth friction improvements

    Autofill Logins Auth friction improvements

    Task/Issue URL: https://app.asana.com/0/0/1203570655543385/f Tech Design URL: CC: @THISISDINOSAUR

    Description: Two small enhancements to the Autofill logins screens related to reducing auth friction flow:

    1. No longer briefly showing the locked UI screen when authentication is not required
    2. Changing the Autofill login session 15 seconds timeout to begin when leaving the Autofill screens, as opposed to when entering

    Steps to test this PR:

    1. Ensure you have at least one Autofill login saved
    2. Access the Autofill logins screen and confirm you see the usual lock screen and are prompted to authenticate
    3. Back out of the screen, then go back in. You should immediately see your saved logins and not be prompted to authenticate
    4. Minimise the app, then re-access the Autofill screens. Confirm you see the usual lock screen and are prompted to authenticate
    5. Wait 10 seconds, then back out of the Autofill screens. Wait another 10 seconds, then re-access the Autofill screens. You should immediately see your saved logins and not be prompted to authenticate
    6. Back out of the Autofill screens again. Wait 15 - 16 seconds, then re-access the Autofill screens. Confirm you see the usual lock screen and are prompted to authenticate

    Copy Testing:

    • [ ] Use of correct apostrophes in new copy, ie rather than '

    Orientation Testing:

    • [ ] Portrait
    • [ ] Landscape

    Device Testing:

    • [ ] iPhone SE (1st Gen)
    • [ ] iPhone 8
    • [ ] iPhone X
    • [ ] iPhone 14 Pro
    • [ ] iPad

    OS Testing:

    • [ ] iOS 14
    • [ ] iOS 15
    • [ ] iOS 16

    Theme Testing:

    • [ ] Light theme
    • [ ] Dark theme

    Internal references:

    Software Engineering Expectations Technical Design Template When ready for review, remember to post the PR in MM

    opened by amddg44 0
  • Fix Privacy Dashboard related pixels

    Fix Privacy Dashboard related pixels

    Task/Issue URL: https://app.asana.com/0/414235014887631/1203568774648452/f

    Description: Fix Privacy Dashboard related pixels. Some of them become obsolete others were not fired in the new implementation.

    Pixels removed:

    • privacyDashboardScorecard
    • privacyDashboardEncryption
    • privacyDashboardNetworks
    • privacyDashboardPrivacyPractices
    • privacyDashboardGlobalStats
    • privacyDashboardManageProtection

    Pixels reintroduced:

    • privacyDashboardProtectionDisabled
    • privacyDashboardProtectionEnabled
    • privacyDashboardReportBrokenSite

    Steps to test this PR:

    1. Check if removed pixels are no longer used.
    2. Check if reintroduced pixel are fired correctly.

    Internal references:

    Software Engineering Expectations Technical Design Template When ready for review, remember to post the PR in MM

    opened by miasma13 0
  • Add dependabot

    Add dependabot

    Task/Issue URL: https://app.asana.com/0/0/1203456821249392/f

    Description: Add dependabot to keep submodules up to date.

    Steps to test this PR:

    1. No good way to test this besides creating merging to the main repo for privacy reference tests or ios-js-support. But it's the same file being used on BSKrepo which was already validated

    Internal references:

    Software Engineering Expectations Technical Design Template When ready for review, remember to post the PR in MM

    opened by Bunn 0
  • Fix tracker animation being frozen when app is backgrounded during playback

    Fix tracker animation being frozen when app is backgrounded during playback

    Task/Issue URL: https://app.asana.com/0/414709148257752/1203552605455710/f

    Description: Fix tracker animation being frozen when app is backgrounded during playback and user returns to the app after couple of seconds.

    Steps to test this PR:

    1. Load or reload page containing trackers.
    2. When the blocked tracker animation starts playing background the app.
    3. Wait couple seconds.
    4. Return to the app.

    Internal references:

    Software Engineering Expectations Technical Design Template When ready for review, remember to post the PR in MM

    opened by miasma13 0
  • Fire button privacy reference tests

    Fire button privacy reference tests

    opened by Bunn 0
Owner
DuckDuckGo
At DuckDuckGo, we're raising the standard of trust online. We believe a more trusted Internet starts with simple and accessible privacy for everyone.
DuckDuckGo
This application was created as a practice and shows a simply VIPER master-detail application.

MARVEL UNIVERSE CHARACTERS This application was created as a practice and shows a simply VIPER master-detail application. Main screen shows a list of

Daniel Moraleda 0 Nov 15, 2021
An iOS application written in Swift to demonstrate how to implement a Clean Architecture in iOS

Reminders iOS An iOS application written in Swift to demonstrate how to implement a Clean Architecture in iOS. Idea The idea is to implement the simpl

Tiago Martinho 306 Nov 9, 2022
MyNews-iOS - A simple iOS mobile application for reading news articles

MyNews A simple iOS mobile application for reading news articles. This app uses

Ernest Nyumbu 1 Mar 31, 2022
A Currency Converter & Calculator IOS application to check, convert and calculate to popular currencies to your favorite ones.

A Currency Converter & Calculator IOS application to check, convert and calculate to popular currencies to your favorite ones.

CCC 64 Jan 1, 2023
Free time picker iOS Application with SwiftUI and Combine

Free time picker iOS application. This is iOS application for search free time in your calendar. Search Detail Environment macOS Catalina 10.15.3(19D7

fromkk 39 Jul 7, 2022
iOS application to tell the time in the British way 🇬🇧⏰

Tell Time ???? ⏰ As a French guy in London, when people told me the time, I was always lost. Now thanks to this app, I can confirm what I hear and wha

Renaud Jenny 50 Dec 18, 2022
RippleQueries is an iOS application built as assessment task at Ripple Egypt. Built Using MVVM (Model-View-ViewModel) and Clean Architecture concepts

RippleRepositories RippleRepositories is an iOS application built as an assessment task at Ripple Egypt. Built Using RxSwift & MVVM (Model-View-ViewMo

Muhammad Ewaily 3 Sep 16, 2021
Mercury is a free English dictionary iOS application.

Mercury - English Dictionary Mercury is a free English dictionary iOS application. Why "Mercury"? In my trip to the USA I have bought the book "Cosmic

Oleg Rybalko 2 Apr 20, 2022
An Unsplash Application for iOS.

Monotone English · 中文 Report Bug · Request Feature Monotone is a Modern Mobile Application, integrated with powerful Unsplash API provided by Unsplash

Xueliang Chen 186 Dec 30, 2022
Teatanic is an iOS application that simulates a tea shop.

teatanic Teatanic is an iOS application that simulates a tea shop. A user is able to search among different tea types and "buy" it. purpose This appli

null 2 Oct 6, 2021
Pasta is clipboard application for ios devices.

pasta Pasta is clipboard application for ios devices. Starting Requirements Xcode 13 Runing Not requires any specific steps, clone and run. git clone

Kemal Sanlı 5 Sep 19, 2022
Simple weather application in Swift for iOS 15.

DaWeather ⛅️ Simple weather application in Swift for iOS 15. General Information DaWeather ⛅️ will help you determine the current weather Features Get

Maksim Pavlovich 2 Jan 16, 2022
Sell Factory is an iOS Application.

Sell-Factory Sell Factory is an iOS Application. Description A social Media platform for users to sell their products without a middle man. Now connec

Pranav Badgi 1 Oct 30, 2021
small iOS & ipadOS application written in SwiftUI and Combine, that fetches twitter users and tweets using Twitter's api

HomeTwitter Small iOS & ipadOS application written in SwiftUI and Combine, that fetches twitter users and tweets using Twitter's api. This is just a s

Sorin Miroiu 1 May 13, 2022
iOS mobile development using Swift - Online Shopping Application

iOS mobile development using Swift - Online Shopping Application - yr4_sem1 This is an application developed as an individual project for Mobile Appli

Madhawa Jayagoda 2 Nov 10, 2021
The iOS application has the Pokémon list. In the app

The iOS application has the Pokémon list. In the app, you can search for Pokémon by name, edit the Pokémon list (mark favorites or delete unwanted ones ?? ), and re-update the Pokémon list from the network.

Volodya 0 Nov 16, 2021
A To Do List application for iOS devices.

Todoey A To Do List application for iOS devices. Tools Used - Realm Database UIStoryBoard Swift Ruby How to run - Clone the repo to local storage. Ins

Kunal Bhandari 0 Nov 29, 2021
A Swift iOS application designed to help DMs / GMs run tabletop RPGs

Project Overview This project is a work in progress iOS app designed to help Dungeon Masters run tabletop role playing games. It is meant as an explor

null 0 Nov 30, 2021
🍳 iOS application for DIET and EAT 🍙

diEAT ?? Summary 다이어트 중 식단 ?? 을 한번에 기록하고 한눈에 확인하고싶어서 만들어보는 식단 관리 프로그램 (iOS 어플) It's a dieat management ios application to record dieat ?? at once ?? T

Dayeon Moon 4 Nov 21, 2022