Compare commits

..

1 commit

Author SHA1 Message Date
Artem Anufrij
f3b83647db fix#132 2020-11-17 15:44:23 +01:00
6 changed files with 27 additions and 337 deletions

View file

@ -1,31 +0,0 @@
# This is the same ID that you've used in meson.build and other files
app-id: com.github.artemanufrij.webpin
# Instead of manually specifying a long list of build and runtime dependencies,
# we can use a convenient pre-made runtime and SDK. For this example, we'll be
# using the runtime and SDK provided by elementary.
runtime: io.elementary.Platform
runtime-version: '6'
sdk: io.elementary.Sdk
# This should match the exec line in your .desktop file and usually is the same
# as your app ID
command: com.github.artemanufrij.webpin
# Here we can specify the kinds of permissions our app needs to run. Since we're
# not using hardware like webcams, making sound, or reading external files, we
# only need permission to draw our app on screen using either X11 or Wayland.
finish-args:
- '--share=ipc'
- '--socket=fallback-x11'
- '--socket=wayland'
# This section is where you list all the source code required to build your app.
# If we had external dependencies that weren't included in our SDK, we would list
# them here.
modules:
- name: webpin
buildsystem: meson
sources:
- type: dir
path: .

View file

@ -33,24 +33,6 @@
</screenshot>
</screenshots>
<releases>
<release version="1.0.5" date="2021-03-24">
<description>
<p>New:</p>
<ul>
<li>Gesture navigation (by Cassidy James Blaede)</li>
</ul>
<p>Fixed:</p>
<ul>
<li>Crash when press '0'</li>
<li>Some improvements by Nathan Bonnemains</li>
</ul>
<p>Translation:</p>
<ul>
<li>Polish (by Michał Nowakowski)</li>
<li>French (by Nathan Bonnemains)</li>
</ul>
</description>
</release>
<release version="1.0.4" date="2019-07-15">
<description>
<p>New:</p>

View file

@ -1,272 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 Artem Anufrij <artem.anufrij@live.de> -->
<component type="desktop">
<id>com.github.artemanufrij.webpin</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>Webpin</name>
<summary>A simple app to pin websites on the desktop</summary>
<description>
<p>Create your own WebApps. Pin your any favorite website on Applications Menu or Plank like a regular desktop app.</p>
<p>Webpin is a fork of Webby (by Erasmo Marín).</p>
</description>
<categories>
<category>Utility</category>
<category>Network</category>
</categories>
<custom>
<value key="x-appcenter-color-primary">#399cd2</value>
<value key="x-appcenter-color-primary-text">rgb(255,255,255)</value>
<value key="x-appcenter-suggested-price">1</value>
</custom>
<developer_name>Artem Anufrij</developer_name>
<url type="homepage">https://artemanufrij.github.io</url>
<url type="bugtracker">https://github.com/artemanufrij/webpin/issues</url>
<url type="help">https://github.com/artemanufrij/webpin/issues</url>
<update_contact>artem.anufrij@live.de</update_contact>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/artemanufrij/webpin/master/screenshots/Screenshot.png</image>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/artemanufrij/webpin/master/screenshots/Screenshot_new_app.png</image>
</screenshot>
</screenshots>
<releases>
<release version="1.0.4" date="2019-07-15">
<description>
<p>New:</p>
<ul>
<li>Enable Media Source Extensions (by Cassidy James Blaede)</li>
</ul>
<p>Translation:</p>
<ul>
<li>Dutch (by Heimen Stoffels)</li>
<li>Spanish (by Manueljlin)</li>
<li>Lithuanian (by welaq)</li>
</ul>
</description>
</release>
<release version="1.0.3" date="2018-11-18">
<description>
<p>New:</p>
<ul>
<li>Theme switcher</li>
<li>Option for minimal UI</li>
</ul>
<p>Improved:</p>
<ul>
<li>Cache choosed icon instead to reference it</li>
</ul>
</description>
</release>
<release version="1.0.2" date="2018-11-02">
<description>
<p>New:</p>
<ul>
<li>Sort items inside app overview</li>
</ul>
<p>Fixed:</p>
<ul>
<li>Custom icon was replaced by default one</li>
</ul>
</description>
</release>
<release version="1.0.1" date="2018-10-30">
<description>
<p>New:</p>
<ul>
<li>Navigation buttons</li>
</ul>
</description>
</release>
<release version="1.0.0" date="2018-10-20">
<description>
<p>New:</p>
<ul>
<li>Moved to Meson</li>
<li>Support for local .html files</li>
</ul>
<p>Fixed:</p>
<ul>
<li>Restore correct window size</li>
<li>Grabing page icon</li>
</ul>
<p>Translation:</p>
<ul>
<li>Dutch (by Heimen Stoffels)</li>
</ul>
</description>
</release>
<release version="0.3.0" date="2018-07-24">
<description>
Prepare for JUNO
</description>
</release>
<release version="0.2.10" date="2018-04-25">
<description>
<p>Fixed:</p>
<ul>
<li>Restore window position for hidden apps</li>
</ul>
</description>
</release>
<release version="0.2.9" date="2018-03-10">
<description>
<p>Improved:</p>
<ul>
<li>Desktop Action Menu</li>
<li>Small UI fixes</li>
</ul>
</description>
</release>
<release version="0.2.8" date="2018-02-12">
<description>
<p>New:</p>
<ul>
<li>back/forward navigation by mouse buttons (8/9) (Thanks to Julian Raschke)</li>
</ul>
<p>Improved:</p>
<ul>
<li>favicon fetching</li>
</ul>
</description>
</release>
<release version="0.2.6" date="2018-02-05">
<description>
<p>New:</p>
<ul>
<li>Save and restore window position</li>
<li>Grab favorite icon</li>
</ul>
<p>Fix:</p>
<ul>
<li>Grab website color</li>
</ul>
</description>
</release>
<release version="0.2.5" date="2017-12-17">
<description>
<p>Translation:</p>
<ul>
<li>Russian (by Camellan)</li>
<li>Lithuanian (by welaq)</li>
</ul>
</description>
</release>
<release version="0.2.4" date="2017-11-27">
<description>
<p>New:</p>
<ul>
<li>Option for Dark Theme</li>
<li>Grab 'theme-color' (if exists) from called website</li>
</ul>
</description>
</release>
<release version="0.2.3" date="2017-11-20">
<description>
<p>Fix:</p>
<ul>
<li>Custom settings in .desktop</li>
</ul>
</description>
</release>
<release version="0.2.2" date="2017-11-20">
<description>
<p>Fix:</p>
<ul>
<li>Custom settings in .desktop</li>
</ul>
</description>
</release>
<release version="0.2.1" date="2017-11-18">
<description>
<p>Fix:</p>
<ul>
<li>Set custom color</li>
</ul>
</description>
</release>
<release version="0.1.13" date="2017-11-18">
<description>
<p>Fix:</p>
<ul>
<li>Desktop icon name</li>
</ul>
</description>
</release>
<release version="0.1.12" date="2017-11-13">
<description>
<p>Fix:</p>
<ul>
<li>Set custom color for headerbar</li>
</ul>
</description>
</release>
<release version="0.1.11" date="2017-11-13">
<description>
<p>Fix:</p>
<ul>
<li>Set custom color for headerbar</li>
</ul>
</description>
</release>
<release version="0.1.10" date="2017-11-11">
<description>
<p>New:</p>
<ul>
<li>Set custom color for headerbar</li>
</ul>
<p>Fix:</p>
<ul>
<li>Open application on clicking desktop notification</li>
</ul>
<p>Translation:</p>
<ul>
<li>Lithuanian (by welaq)</li>
</ul>
</description>
</release>
<release version="0.1.9" date="2017-10-15">
<description>
<p>New:</p>
<ul>
<li>Copy current URI into clipboard</li>
</ul>
<p>Fix:</p>
<ul>
<li>Open WebApp on single click instead double click</li>
</ul>
</description>
</release>
</releases>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">none</content_attribute>
<content_attribute id="violence-fantasy">none</content_attribute>
<content_attribute id="violence-realistic">none</content_attribute>
<content_attribute id="violence-bloodshed">none</content_attribute>
<content_attribute id="violence-sexual">none</content_attribute>
<content_attribute id="violence-desecration">none</content_attribute>
<content_attribute id="violence-slavery">none</content_attribute>
<content_attribute id="violence-worship">none</content_attribute>
<content_attribute id="drugs-alcohol">none</content_attribute>
<content_attribute id="drugs-narcotics">none</content_attribute>
<content_attribute id="drugs-tobacco">none</content_attribute>
<content_attribute id="sex-nudity">none</content_attribute>
<content_attribute id="sex-themes">none</content_attribute>
<content_attribute id="sex-homosexuality">none</content_attribute>
<content_attribute id="sex-prostitution">none</content_attribute>
<content_attribute id="sex-adultery">none</content_attribute>
<content_attribute id="sex-appearance">none</content_attribute>
<content_attribute id="language-profanity">none</content_attribute>
<content_attribute id="language-humor">none</content_attribute>
<content_attribute id="language-discrimination">none</content_attribute>
<content_attribute id="social-chat">none</content_attribute>
<content_attribute id="social-info">none</content_attribute>
<content_attribute id="social-audio">none</content_attribute>
<content_attribute id="social-location">none</content_attribute>
<content_attribute id="social-contacts">none</content_attribute>
<content_attribute id="money-purchasing">none</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>
</component>

View file

@ -46,6 +46,18 @@ namespace Webpin {
construct {
this.flags |= GLib.ApplicationFlags.HANDLES_OPEN;
this.flags |= ApplicationFlags.HANDLES_COMMAND_LINE;
var action_quit = new SimpleAction ("quit", null);
add_action (action_quit);
string[] accel_quit = {"<Control>q", "0"};
set_accels_for_action ("app.quit", accel_quit);
action_quit.activate.connect (
() => {
if (mainwindow != null) {
mainwindow.destroy ();
}
});
create_cache_folders ();
}

View file

@ -65,6 +65,8 @@ namespace Webpin.Widgets {
enable_webgl = true
}
};
web_view.web_context.set_spell_checking_enabled(true);
web_view.web_context.set_spell_checking_languages({"en_US", "de_DE"});
cookie_manager = web_view.web_context.get_cookie_manager ();
cookie_manager.set_accept_policy (WebKit.CookieAcceptPolicy.ALWAYS);

View file

@ -232,17 +232,17 @@ namespace Webpin.Widgets.Views {
if (msg.status_code == 200) {
var body = (string)msg.response_body.data;
Regex regex = null;
try {
regex = new Regex ("(?<=theme-color).*((?<=content=)\"?(#[0-9a-fA-F]*))");
regex = new Regex ("(?<=<meta name=\"theme-color\" content=\")#[0-9a-fA-F]{6}");
} catch (Error err) {
warning (err.message);
}
MatchInfo match_info = null;
if (regex != null && regex.match (body, 0, out match_info)) {
var result = match_info.fetch (match_info.get_match_count () - 1);
stdout.printf("color: %s\n", result);
var result = match_info.fetch (0);
Gdk.RGBA return_value = {0, 0, 0, 1};
if (return_value.parse (result)) {
Idle.add (
@ -252,12 +252,12 @@ namespace Webpin.Widgets.Views {
});
}
}
var icon_path = "";
if (tmp_icon_file == "") {
try {
regex = new Regex ("(?<=\"fluid-icon\" href=\")[/\\w\\.:\\-]*");
if (regex.match (body, 0, out match_info)) {
icon_path = format_icon_path (url, match_info.fetch (0));
var icon_path = format_icon_path (url, match_info.fetch (0));
download_icon (icon_path);
}
} catch (Error err) {
@ -267,9 +267,9 @@ namespace Webpin.Widgets.Views {
if (tmp_icon_file == "") {
try {
regex = new Regex ("(?<=rel=icon)[\\w\\+\\/=\\s]*(?<=href=)([\\w\\+\\/=\\.)]*64\\.(svg|png))");
regex = new Regex ("(rel=\"icon\").*href=\"([\\-/\\w]*64.png)");
if (regex.match (body, 0, out match_info)) {
icon_path = format_icon_path (url, match_info.fetch (match_info.get_match_count () - 2));
var icon_path = format_icon_path (url, match_info.fetch (match_info.get_match_count () - 1));
download_icon (icon_path);
}
} catch (Error err) {
@ -279,9 +279,9 @@ namespace Webpin.Widgets.Views {
if (tmp_icon_file == "") {
try {
regex = new Regex ("(?<=rel=icon)[\\w\\+\\/=\\s]*(?<=href=)([\\w\\+\\/=\\.)]*96\\.(svg|png))");
regex = new Regex ("(rel=\"icon\").*href=\"([\\-/\\w]*96.png)");
if (regex.match (body, 0, out match_info)) {
icon_path = format_icon_path (url, match_info.fetch (match_info.get_match_count () - 1));
var icon_path = format_icon_path (url, match_info.fetch (match_info.get_match_count () - 1));
download_icon (icon_path);
}
} catch (Error err) {
@ -293,7 +293,7 @@ namespace Webpin.Widgets.Views {
try {
regex = new Regex ("(\"apple-touch-icon\").*href=\"([\\-/\\w]*.png)");
if (regex.match (body, 0, out match_info)) {
icon_path = format_icon_path (url, match_info.fetch (match_info.get_match_count () - 1));
var icon_path = format_icon_path (url, match_info.fetch (match_info.get_match_count () - 1));
download_icon (icon_path);
}
} catch (Error err) {
@ -305,7 +305,7 @@ namespace Webpin.Widgets.Views {
try {
regex = new Regex ("(?<=\"mask-icon\" href=\")[/\\w\\.:\\-]*");
if (regex.match (body, 0, out match_info)) {
icon_path = format_icon_path (url, match_info.fetch (0));
var icon_path = format_icon_path (url, match_info.fetch (0));
download_icon (icon_path);
}
} catch (Error err) {
@ -363,9 +363,6 @@ namespace Webpin.Widgets.Views {
tmp_icon_file = GLib.Path.build_filename (Environment.get_tmp_dir (), Random.next_int ().to_string () + tmp_icon_ext);
stdout.printf("source: %s\n", url);
stdout.printf("destination: %s\n", tmp_icon_file);
var s_file = File.new_for_uri (url);
var d_file = File.new_for_path (tmp_icon_file);
@ -373,7 +370,7 @@ namespace Webpin.Widgets.Views {
try {
copy_done = s_file.copy (d_file, FileCopyFlags.OVERWRITE);
} catch (Error err) {
stdout.printf ("%s\n", err.message);
warning (err.message);
}
if (copy_done && tmp_icon_ext != ".svg") {
try {