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

Development #13

Merged
merged 3 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
73 changes: 68 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
### NovaNav: Lightweight browser for Linux*
NovaNav: Lightweight browser for Linux and macOS, delivering fast, distraction-free browsing experience. This is my own version for Arc Browser mostly for Linux.
#### 🌐 NovaNav - Super Lightweight Browser

NovaNav: Lightweight browser* for Linux and macOS, delivering fast, distraction-free browsing experience. This is my own version for Arc Browser mostly for Linux.

<img src="./images/icons/distraction.png" alt="logo" width="85" height="85">

NovaNav, inspired by Arc Browser, is a minimalist and distraction-free web browser developed using PyQt5 and QtWebEngineWidgets. It offers essential browsing functionalities while focusing on simplicity and efficiency. With NovaNav, users can effortlessly navigate the web, open multiple tabs, and adjust zoom settings for optimal viewing.
The browser's clean interface and intuitive design make it ideal for users who prefer a clutter-free browsing experience. By minimizing distractions and prioritizing essential features, NovaNav aims to provide a seamless and enjoyable web browsing experience.

<sub>* This is currently an experimental phase where the primary focus is on making the system functional and establishing a practical and logical pathway that aligns with both my vision and the project's goals. It might contain errors, bugs, etc. Many other non-core elements of the project are considered secondary.</sub>ub>

![Version](https://img.shields.io/github/release/felipealfonsog/NovaNav.svg?style=flat&color=blue)
![Main Language](https://img.shields.io/github/languages/top/felipealfonsog/NovaNav.svg?style=flat&color=blue)
[![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/)


[![BSD 3-Clause License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)

<!--
[![GPL license](https://img.shields.io/badge/License-GPL-blue.svg)](http://perso.crans.org/besson/LICENSE.html)
-->

[![Vim](https://img.shields.io/badge/--019733?logo=vim)](https://www.vim.org/)
[![Visual Studio Code](https://img.shields.io/badge/--007ACC?logo=visual%20studio%20code&logoColor=ffffff)](https://code.visualstudio.com/)


#### Current Features
#### 🚀 Current Features (Some might be in progress)

- Tab Management: Open multiple tabs and switch between them seamlessly.
- URL Navigation: Enter URLs directly or use the search bar to navigate to websites.
- Zoom Control: Adjust zoom settings to customize the display of web pages.
- User-friendly Interface: Clean and intuitive interface for easy navigation and usage.
- Basic Settings: Customize settings such as homepage and default search engine.


<sub>*Still experimental. Might contain bugs. </sub>
#### Screenshots

[![View Screenshots](https://img.shields.io/badge/View-Screenshots-green)](#)

#### Screenshot Linux

Expand All @@ -17,31 +50,61 @@ NovaNav: Lightweight browser for Linux and macOS, delivering fast, distraction-f
<img src="./images/macos/sshot-2.png" alt="Screenshot" width="400" height="350">
</p>


#### Future Goals
#### 🚀 Future Goals

- Implement support for bookmarks to allow users to save their favorite websites for quick access.
- Enhance tab management features, such as rearranging tabs and grouping them into tab sets.
- Improve compatibility with various web standards and technologies to ensure a seamless browsing experience.
- Introduce customization options for user interface themes and keyboard shortcuts to cater to different user preferences.
- Enhance privacy and security features to protect user data and browsing activities from unauthorized access.


#### Requirements

Install Python3, then:

You might need perhaps to create an enviroment for pip:
```
python3 -m venv novanav-env
source novanav-env/bin/activate
```

If not, just go with this:

```
pip3 install -r requirements.txt
```

#### Runt it
Runt it with:

```
python3 ./src/novanav.py
```

#### How-to
#### How-to - NovaNav

```
ctrl+t (New tab)
ctrl+v (hide tabs for distraction-free)
ctrl+q (quit)
```

#### 🤝 Support and Contributions

If you find this project helpful and would like to support its development, there are several ways you can contribute:

- **Code Contributions**: If you're a developer, you can contribute by submitting pull requests with bug fixes, new features, or improvements. Feel free to fork the project and create your own branch to work on.
- **Bug Reports and Feedback**: If you encounter any issues or have suggestions for improvement, please open an issue on the project's GitHub repository. Your feedback is valuable in making the project better.
- **Documentation**: Improving the documentation is always appreciated. If you find any gaps or have suggestions to enhance the project's documentation, please let me know.

[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-%E2%98%95-FFDD00?style=flat-square&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/felipealfonsog)
[![PayPal](https://img.shields.io/badge/Donate%20with-PayPal-00457C?style=flat-square&logo=paypal&logoColor=white)](https://www.paypal.me/felipealfonsog)
[![GitHub Sponsors](https://img.shields.io/badge/Sponsor%20me%20on-GitHub-%23EA4AAA?style=flat-square&logo=github-sponsors&logoColor=white)](https://github.com/sponsors/felipealfonsog)

Your support and contributions are greatly appreciated! Thank you for your help in making this project better. If you need to mail me, this is the way: f.alfonso@res-ear.ch (I'm Felipe, the Computer Science Engineer behind this idea. Cheers!)

#### 📄 License

This project is licensed under the [BSD 3-Clause License](LICENSE). It will have some restrictions, ask about it.
46 changes: 20 additions & 26 deletions src/novanav_default.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from PyQt5.QtCore import QUrl, Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QLineEdit, QPushButton, QWidget, QTabWidget, QShortcut, QDialog
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage, QWebEngineSettings, QWebEngineProfile
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineSettings

class URLInputDialog(QDialog):
def __init__(self):
Expand Down Expand Up @@ -54,33 +54,21 @@ def set_permissions_and_settings(self):
settings.setAttribute(QWebEngineSettings.FullScreenSupportEnabled, True)
settings.setAttribute(QWebEngineSettings.ErrorPageEnabled, True)

# Connect linkClicked signal to handle_link_click method
self.page().linkClicked.connect(self.handle_link_click)
# Connect urlChanged signal to handle_url_changed method
self.page().urlChanged.connect(self.handle_url_changed)

def create_new_tab(self, url):
if not url.startswith("http"):
url = "http://" + url
browser = QWebEngineView()
browser.setUrl(QUrl(url))
browser.page().profile().setHttpUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36") # Customize the user agent to avoid blocking by some websites
browser.titleChanged.connect(lambda title, browser=browser: self.set_tab_title(browser, title[:20])) # Limit title to 20 characters
browser.page().fullScreenRequested.connect(lambda request: request.accept())
browser.page().setZoomFactor(0.65) # Set default zoom factor to 65%

self.tab_widget.addTab(browser, "")

def handle_link_click(self, url):
def handle_url_changed(self, url):
# Get the HTML content of the current page
html_content = self.page().toHtml(self.handle_html_content)
self.page().toHtml(self.handle_html_content)

def handle_html_content(self, html):
# Check if the HTML contains the target="_blank" attribute
if '_blank' in html:
# Open the link in a new tab
self.create_new_tab(url.toString())
self.create_new_tab(html)
else:
# Open the link in the same tab
self.page().setUrl(url)
self.page().setUrl(html)

def show_url_input_dialog(self):
self.url_input_dialog.show()
Expand All @@ -94,6 +82,19 @@ def open_new_tab(self):
def close_tab(self, index):
self.tab_widget.removeTab(index)

def create_new_tab(self, url):
if not url.startswith("http"):
url = "http://" + url
browser = QWebEngineView()
browser.setUrl(QUrl(url))
browser.page().profile().setHttpUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36") # Customize the user agent to avoid blocking by some websites
browser.titleChanged.connect(lambda title, browser=browser: self.set_tab_title(browser, title[:20])) # Limit title to 20 characters
browser.page().fullScreenRequested.connect(lambda request: request.accept())
browser.page().urlChanged.connect(self.handle_url_changed)
browser.page().setZoomFactor(0.65) # Set default zoom factor to 65%

self.tab_widget.addTab(browser, "")

def set_tab_title(self, browser, title):
index = self.tab_widget.indexOf(browser)
self.tab_widget.setTabText(index, title)
Expand All @@ -108,13 +109,6 @@ def zoom_out(self):
if current_browser:
current_browser.setZoomFactor(current_browser.zoomFactor() - 0.1)

def toggle_titles(self):
for i in range(self.tab_widget.count()):
browser = self.tab_widget.widget(i)
title = browser.title() if self.tab_widget.tabBar().isVisible() else self.tab_widget.tabText(i)
self.set_tab_title(browser, title[:20])
self.tab_widget.tabBar().setVisible(not self.tab_widget.tabBar().isVisible())

if __name__ == "__main__":
app = QApplication(sys.argv)
window = NovaNav()
Expand Down