diff --git a/src/plugins/GreaseMonkey/gm_downloader.cpp b/src/plugins/GreaseMonkey/gm_downloader.cpp index e3ceccf48..f9f83f356 100644 --- a/src/plugins/GreaseMonkey/gm_downloader.cpp +++ b/src/plugins/GreaseMonkey/gm_downloader.cpp @@ -1,6 +1,6 @@ /* ============================================================ * GreaseMonkey plugin for QupZilla -* Copyright (C) 2012-2016 David Rosca +* Copyright (C) 2012-2017 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -127,7 +127,7 @@ void GM_Downloader::requireDownloaded() QSettings settings(m_manager->settinsPath() + QL1S("/greasemonkey/requires/requires.ini"), QSettings::IniFormat); settings.beginGroup("Files"); - settings.setValue(m_reply->request().url().toString(), fileName); + settings.setValue(m_reply->request().url().toString(), QFileInfo(fileName).fileName()); } } diff --git a/src/plugins/GreaseMonkey/gm_manager.cpp b/src/plugins/GreaseMonkey/gm_manager.cpp index 42d4bc617..bf67fa651 100644 --- a/src/plugins/GreaseMonkey/gm_manager.cpp +++ b/src/plugins/GreaseMonkey/gm_manager.cpp @@ -82,7 +82,10 @@ QString GM_Manager::requireScripts(const QStringList &urlList) const foreach (const QString &url, urlList) { if (settings.contains(url)) { - const QString fileName = settings.value(url).toString(); + QString fileName = settings.value(url).toString(); + if (!QFileInfo(fileName).isAbsolute()) { + fileName = m_settingsPath + QL1S("/greasemonkey/requires/") + fileName; + } script.append(QzTools::readAllFileContents(fileName).trimmed() + '\n'); } }