feat: ServiceWorkerMain.scriptURL (#45863)
feat: serviceWorker.scriptURL
This commit is contained in:
parent
30d2fadb28
commit
afca4e271e
4 changed files with 23 additions and 0 deletions
|
@ -282,6 +282,12 @@ GURL ServiceWorkerMain::ScopeURL() const {
|
|||
return version_info()->scope;
|
||||
}
|
||||
|
||||
GURL ServiceWorkerMain::ScriptURL() const {
|
||||
if (version_destroyed_)
|
||||
return {};
|
||||
return version_info()->script_url;
|
||||
}
|
||||
|
||||
// static
|
||||
gin::Handle<ServiceWorkerMain> ServiceWorkerMain::New(v8::Isolate* isolate) {
|
||||
return gin::Handle<ServiceWorkerMain>();
|
||||
|
@ -330,6 +336,7 @@ void ServiceWorkerMain::FillObjectTemplate(
|
|||
&ServiceWorkerMain::CountExternalRequestsForTest)
|
||||
.SetProperty("versionId", &ServiceWorkerMain::VersionID)
|
||||
.SetProperty("scope", &ServiceWorkerMain::ScopeURL)
|
||||
.SetProperty("scriptURL", &ServiceWorkerMain::ScriptURL)
|
||||
.Build();
|
||||
}
|
||||
|
||||
|
|
|
@ -147,6 +147,7 @@ class ServiceWorkerMain final
|
|||
|
||||
int64_t VersionID() const;
|
||||
GURL ScopeURL() const;
|
||||
GURL ScriptURL() const;
|
||||
|
||||
// Version ID unique only to the StoragePartition.
|
||||
int64_t version_id_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue