Commit graph

97 commits

Author SHA1 Message Date
modmuss50
3142c4a4fd Browser: Add "Copy link" context menu item 2020-05-06 12:14:54 +02:00
Andreas Kling
d6ab9e6790 Browser: Add a basic GUI download feature
We now allow you to download files by right-clicking a link and then
choosing "Download".

All files are currently saved to the standard downloads location that
we get from Core::StandardPaths::downloads_directory().

In the future, we'll probably want to come up with a more restrictive
way of doing the "write to disk" portion of this.
We should also improve the ProtocolServer to allow streaming of data
instead of writing everything in one big go.

At the moment, I'm just pretty happy with this GUI. :^)
2020-05-05 23:58:22 +02:00
Andreas Kling
588e18721d Browser: Add a simple context menu for hyperlinks
This only has "Open" and "Open in new tab" for now. :^)
2020-05-05 22:42:50 +02:00
Andreas Kling
e09b83c60c LibTextCodec: Start fleshing out a simple text codec library
We're starting with a very basic decoding API and only ISO-8859-1 and
UTF-8 decoding (and UTF-8 decoding is really a no-op since String is
expected to be UTF-8.)
2020-05-03 23:01:58 +02:00
Ben Wiederhake
da837fe46e Meta: Fix Makefile permissions (not executable) 2020-05-03 14:24:08 +02:00
AnotherTest
7670e5ccf0 LibCore+LibHTTP: Move out the HTTP handler and add HTTPS 2020-05-02 12:24:10 +02:00
Dylan Katz
47f413c47f Browser: Add missing tooltip to bookmark button
The tip will say "Add Bookmark" if not a bookmark and "Remove
Bookmark" if it is.
2020-04-30 08:52:21 +02:00
Emanuele Torre
a220236cde Browser: Add missing #pragma once in Tab.h 2020-04-29 09:38:11 +02:00
Andreas Kling
3cc31ff3f3 Browser: Make Ctrl+L select the location bar again
..by making sure the Tab actions are scoped to the Tab.
2020-04-28 20:36:08 +02:00
Andreas Kling
5b4b72e699 Browser: Don't put favicons as the window icon
It's nicer to always use the browser's own app icon instead. :^)
2020-04-28 20:31:51 +02:00
Andres Vieira
88368df9a2 Base+Browser: Add an icon for the serenity Browser and make it use it
Browser was using the filetype-html icon instead of a dedicated one, so
we now have the globe from that icon reimagined and in good Buggie
company :^)
2020-04-26 21:13:57 +02:00
Andreas Kling
421619fe2f Browser: Rejig the "on_load_counter_change" hook when switching tabs
This feels a little shoddy, but we need to make sure that updates end
up on the right statusbar (since there is one statusbar per tab.)
2020-04-25 17:27:55 +02:00
Andreas Kling
9093625546 Browser: Unveil /etc/passwd so we can find our home directory if needed
Fixes #1952.
2020-04-25 17:21:59 +02:00
Andreas Kling
bd45b2b8d3 Browser: Share one BookmarksBarWidget between all Tabs 2020-04-25 17:20:23 +02:00
Brendan Coles
6dde2c7f47 Browser: Add Browser.ini configuration file
The Browser can now load a home page URL from the user's Browser.ini
configuration file rather than using a hard-coded URL.
2020-04-25 10:55:55 +02:00
Andreas Kling
260e4049ff Browser: Use the active tab's favicon as the window icon :^) 2020-04-24 22:47:53 +02:00
Andreas Kling
d6bbf12b7c LibGUI: Add "uniform tabs" mode to TabWidget (all tabs have same width)
...and enable this in the main Browser UI. :^)
2020-04-24 22:36:25 +02:00
Andreas Kling
682f0ac93b Browser: React to favicon notifications and put favicons in the tabs! 2020-04-24 22:28:05 +02:00
Andreas Kling
3fcfab4404 Browser: Move the "About" action to WindowActions 2020-04-24 20:50:06 +02:00
Andreas Kling
dfe8dea2ac Browser: Remove padding from the main TabWidget
This makes the active tab "take over" the whole window UI, even though
it's actually inside a TabWidget.
2020-04-24 20:42:34 +02:00
Andreas Kling
9d8620f956 Browser: Add icons for the "new tab" and "close tab" actions 2020-04-24 20:42:34 +02:00
Andreas Kling
5c2bdbf27f Browser+LibWeb: Open link in new tab on Ctrl+Click :^) 2020-04-24 14:43:56 +02:00
Andreas Kling
d5d8e87d56 Browser: Scope tab-specific actions to the tab itself
This makes LibGUI choose the correct action depending on which tab
is currently active (technically which tab is *focused*.)

Fixes #1935.
2020-04-24 14:34:24 +02:00
Linus Groh
896decd4d5 Browser: Open links with target="_blank" in new tab 2020-04-24 14:34:11 +02:00
Linus Groh
061205b3b3 LibWeb: Pass link target to HtmlView's on_link_click callback 2020-04-24 14:34:11 +02:00
Andreas Kling
1b8b492258 Browser: Add "next tab" and "previous tab" actions
Now you can switch between the open tabs with Ctrl+PgUp and Ctrl+PgDn
2020-04-23 21:43:24 +02:00
Andreas Kling
312501f309 Browser: Add "Close tab" action (Ctrl+W) :^)
Note that this is a little bit unreliable with the keyboard shortcut
since LibGUI can get confused about which Action it's supposed to use
as each Browser::Tab has its own "close tab" action. This will need
to be fixed in LibGUI.
2020-04-23 21:36:17 +02:00
Andreas Kling
476a4475e5 Browser: Add "New tab" action (Ctrl+T) :^)
This also introduces a WindowActions collection of actions that are not
specific to the currently open tab, but nevertheless part of its menus.
2020-04-23 21:28:25 +02:00
Andreas Kling
4e8b6e48fd Browser: Start implementing tabbed browsing! :^)
This patch moves most of the Browser UI into a Tab class. The main UI
now mainly consists of a GUI::TabWidget that Tab objects are added to.

I'm going with the "tabs on top" style here, since I like how it makes
it feel like each tab has its own UI controls (which it actually does!)
2020-04-23 21:16:11 +02:00
Andreas Kling
0af5e0b9f8 Applications: Tweak main layout spacing and background 2020-04-23 18:30:59 +02:00
Andreas Kling
ab336e895f LibGUI: Add a ToolBarContainer widget and put most ToolBars in one
This mimics the Explorer toolbar container from Windows 2000 and looks
pretty neat! :^)
2020-04-23 17:44:49 +02:00
Andreas Kling
9ab9f97464 Browser: Remove no-op from the BooksmarksBarWidget
Widget::child_widgets() is a *copy* of the list of child widgets. :^)
2020-04-23 14:10:32 +02:00
Andreas Kling
705cee528a LibGUI: Make it easier to create checkable GUI::Actions
This patch adds GUI::Action::create_checkable() helpers that work just
like the existing create() helpers, but the actions become checkable(!)

Clients are no longer required to manage the checked state of their
actions manually, but instead they will be checked/unchecked as needed
by GUI::Action itself before the activation hook is fired.
2020-04-21 17:21:28 +02:00
Andreas Kling
52a250cb61 LibGUI: Make MenuBar a Core::Object
This makes it show up in Inspector with all the menus inside it. :^)
2020-04-21 16:19:18 +02:00
Vojtech Moravec
90f8a7a36b
Browser: Make removal of bookmark persistent (#1865)
Json model wasn't stored after bookmark removal.
Store the model if remove() was successful.
2020-04-19 14:43:16 +02:00
Sergey Bugaev
eacde6c499 Browser: Fix opening non-file URLs passed in argv 2020-04-19 11:14:26 +02:00
Andreas Kling
afb9ee2af8 Browser: Use URL::create_with_file_protocol() in one place 2020-04-18 22:02:41 +02:00
Nick Tiberi
e639c5bc25 Browser: Default page title to URL if no title is provided 2020-04-15 08:39:11 +02:00
Andreas Kling
8ef9c272b6 Browser: Accept file:// URLs on the command line
This could be a lot nicer, but at least we can open file:// URLs now.
2020-04-11 23:11:10 +02:00
Andreas Kling
26eeaef0a8 LibGUI: Add MenuBar::add_menu(name)
This allows us to construct menus in a more natural way:

    auto& file_menu = menubar->add_menu("File");
    file_menu.add_action(...);

Instead of the old way:

    auto file_menu = GUI::Menu::construct();
    file_menu->add_action(...);
    menubar->add_menu(file_menu);
2020-04-04 12:58:05 +02:00
Brendan Coles
8780151155 Browser: Add Reload option to app menu with F5 shortcut key 2020-04-04 11:47:03 +02:00
Andreas Kling
297e6625f3 Browser: Refuse to run as root 2020-03-31 13:02:05 +02:00
Emanuel Sprung
c9059c12dc Browser: Let the user add/remove bookmarks to the bookmarks bar
This patchset adds a Button to the toolbar (right next to the location field)
with a star icon. The star is white if the currently visited url is not yet
bookmarked and yellow if a bookmark for the url exists.

After adding or removing a bookmark, the bookmark json file is synced to disk.
Therefore, some new pledge/unveil's have been added.
2020-03-27 14:12:18 +01:00
Emanuel Sprung
337ade9e4c Browser: Add bookmarks bar
This patchset adds a bookmark bar that is backed by a json file backend.
The json file is loaded and checked for the format. According to the
format, the bookmarks bar is populated with the bookmark items.

If the bookmarks do not fit into one line, an expader button is shown
that brings up a menu containing the missing bookmark items.

There is currently no way to add or remove bookmarks. A hover over a
bookmark is also not yet showing the url in the statusbar.
2020-03-27 14:12:18 +01:00
Emanuel Sprung
a9e943ae4c Browser: Add empty, toogleable bookmarks bar 2020-03-27 14:12:18 +01:00
Andreas Kling
47fdac7cea Browser: Fix unintentional Web::Element copy 2020-03-18 17:13:22 +01:00
Andreas Kling
9c9d3f0904 LibWeb: Parse <script> elements and run any JavaScript found inside
This patch begins integrating LibJS into LibWeb. Document holds the
JS::Interpreter for now, and it is created on demand when you first
call Document::interpreter().

We also add a simple "alert()" function to the global object.
2020-03-14 13:25:38 +01:00
Andreas Kling
830a57c6b2 LibWeb: Rename directory LibHTML => LibWeb
Let's rename this to LibWeb since it aims to provide more parts of the
web platform than just HTML. :^)
2020-03-07 10:32:51 +01:00
Andreas Kling
7a6c4a72d5 LibWeb: Move everything into the Web namespace 2020-03-07 10:27:02 +01:00
Andreas Kling
028c011760 LibCore: Make Core::Object::add<ChildType> return a ChildType&
Since the returned object is now owned by the callee object, we can
simply vend a ChildType&. This allows us to use "." instead of "->"
at the call site, which is quite nice. :^)
2020-03-04 21:04:06 +01:00