Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !24923

Remove page reload in pwa.js.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged XhmikosR requested to merge v4-dev-xmr-docs-sw into v4-dev 7 years ago
  • Overview 0
  • Commits 4
  • Pipelines 0
  • Changes 1

/CC @Lyricalz: I think this should be fine, i.e. leaving it up to the browser to do its job.

Fixes #24868 (closed)

Compare
  • v4-dev (base)

and
  • latest version
    41b6212f
    4 commits, 2 years ago

1 file
+ 2
- 15

    Preferences

    File browser
    Compare changes
assets/js/src/pwa.js
+ 2
- 15
  • View file @ 41b6212f

  • Edit in single-file editor

  • Open in Web IDE


@@ -7,24 +7,11 @@
window.addEventListener('load', function () {
navigator.serviceWorker.register('/sw.js').then(function (registration) { // eslint-disable-line compat/compat
console.log('ServiceWorker registration successful with scope: ', registration.scope)
registration.onupdatefound = function () {
var installingWorker = registration.installing
installingWorker.onstatechange = function () {
switch (installingWorker.state) {
case 'installed':
if (navigator.serviceWorker.controller) { // eslint-disable-line compat/compat
console.log('new update available')
location.reload(true)
}
break
default:
}
}
}
}).catch(function (err) {
console.log('ServiceWorker registration failed: ', err)
})
})
} else {
console.log('Service workers are not supported.')
}
}())
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
3
docs js v4
3
docs js v4
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
XhmikosR
Reference: twbs/bootstrap!24923
Source branch: v4-dev-xmr-docs-sw

Menu

Explore Projects Groups Snippets