summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/user_script.cpp16
-rw-r--r--src/core/user_script.h5
2 files changed, 20 insertions, 1 deletions
diff --git a/src/core/user_script.cpp b/src/core/user_script.cpp
index 912b204b7..6f5828cbf 100644
--- a/src/core/user_script.cpp
+++ b/src/core/user_script.cpp
@@ -81,6 +81,7 @@ UserScript::UserScript(const UserScript &other)
return;
scriptData.reset(new UserScriptData(*other.scriptData));
m_name = other.m_name;
+ m_url = other.m_url;
}
UserScript::~UserScript()
@@ -96,6 +97,7 @@ UserScript &UserScript::operator=(const UserScript &other)
}
scriptData.reset(new UserScriptData(*other.scriptData));
m_name = other.m_name;
+ m_url = other.m_url;
return *this;
}
@@ -125,6 +127,16 @@ void UserScript::setSourceCode(const QString &source)
parseMetadataHeader();
}
+QUrl UserScript::sourceUrl() const
+{
+ return m_url;
+}
+
+void UserScript::setSourceUrl(const QUrl &url)
+{
+ m_url = url;
+}
+
UserScript::InjectionPoint UserScript::injectionPoint() const
{
if (isNull())
@@ -173,7 +185,9 @@ bool UserScript::operator==(const UserScript &other) const
return worldId() == other.worldId()
&& runsOnSubFrames() == other.runsOnSubFrames()
&& injectionPoint() == other.injectionPoint()
- && name() == other.name() && sourceCode() == other.sourceCode();
+ && name() == other.name()
+ && sourceCode() == other.sourceCode()
+ && sourceUrl() == other.sourceUrl();
}
void UserScript::initData()
diff --git a/src/core/user_script.h b/src/core/user_script.h
index 8f65f4b74..07fba90f4 100644
--- a/src/core/user_script.h
+++ b/src/core/user_script.h
@@ -56,6 +56,7 @@
#include <QtCore/QScopedPointer>
#include <QtCore/QSharedData>
#include <QtCore/QString>
+#include <QtCore/QUrl>
struct UserScriptData;
@@ -84,6 +85,9 @@ public:
QString sourceCode() const;
void setSourceCode(const QString &);
+ QUrl sourceUrl() const;
+ void setSourceUrl(const QUrl &);
+
InjectionPoint injectionPoint() const;
void setInjectionPoint(InjectionPoint);
@@ -103,6 +107,7 @@ private:
QScopedPointer<UserScriptData> scriptData;
QString m_name;
+ QUrl m_url;
};
} // namespace QtWebEngineCore