MCPcopy Create free account
hub / github.com/LeFroid/Viper-Browser / installScript

Method installScript

src/core/user_scripts/UserScriptManager.cpp:128–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void UserScriptManager::installScript(const QUrl &url)
129{
130 if (!url.isValid())
131 return;
132
133 QNetworkRequest request;
134 request.setUrl(url);
135
136 DownloadManager *downloadMgr = sBrowserApplication->getDownloadManager();
137 InternalDownloadItem *item = downloadMgr->downloadInternal(request, m_model->m_userScriptDir, false);
138 connect(item, &InternalDownloadItem::downloadFinished, [=](const QString &filePath){
139 UserScript script;
140 if (script.load(filePath, m_model->m_scriptTemplate))
141 m_model->addScript(std::move(script));
142 });
143}
144
145void UserScriptManager::createScript(const QString &name, const QString &nameSpace, const QString &description, const QString &version)
146{

Callers 1

Calls 5

setUrlMethod · 0.80
getDownloadManagerMethod · 0.80
downloadInternalMethod · 0.80
addScriptMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected