Skip to content
Permalink
Browse files

fix: can not register service worker on single page

  • Loading branch information...
nguyenvanduocit committed Mar 16, 2019
1 parent 8924cb0 commit 81b95d146f47ccabd263e17426c5c0ed840d7458
@@ -1,6 +1,7 @@
languageCode: vi-vn
copyright: This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
title: 12bit.vn
description: write and share to learn
theme: blog
enableGitInfo: true
enableEmoji: true
@@ -12,6 +12,7 @@ tags:
- puppeteer
- web scraping
title: Lấy dữ liệu web với Node.js và Puppeteer
description: Một trong những case study mà bạn có thể gặp đó là lấy dữ liệu từ những website khác và lưu vào database
---

Một trong những case study mà bạn có thể gặp đó là lấy dữ liệu từ những website khác và lưu vào database của riêng mình dùng để làm những trang như tổng hợp link, tin tức.
@@ -65,7 +65,7 @@ if ('serviceWorker' in navigator) {
// It won't be able to control pages unless it's located at the same level or higher than them.
// *Don't* register service worker file in, e.g., a scripts/ sub-directory!
// See https://github.com/slightlyoff/ServiceWorker/issues/468
navigator.serviceWorker.register('service-worker.js').then(function(reg) {
navigator.serviceWorker.register('/service-worker.js').then(function(reg) {
// updatefound is fired if service-worker.js changes.
reg.onupdatefound = function() {
// The updatefound event implies that reg.installing is set; see
@@ -20,6 +20,7 @@ const resultPanel = document.getElementById('hits')

search.addWidget(
instantsearch.widgets.searchBox({
label: 'tìm kiếm',
container: '#search-box',
placeholder: 'Tìm kiếm',
reset: false,
@@ -1,12 +1,11 @@
@import url('https://fonts.googleapis.com/css?family=Inconsolata:400,700&subset=vietnamese');
$font-body: 'Inconsolata', monospace;
$font-title: 'Inconsolata', monospace;
$font-weight-normal: 400;
$font-weight-bold: 700;

$content-width: 700px;

$color-primary: #56BD77;
$color-primary: #242424;
$color-secondary: '';
$color-dark: #2c2c2c;
$color-gray: #ccc;
@@ -1 +1,2 @@
@import "mailchimp"
@import "mailchimp";
@import "../instance-search";
@@ -0,0 +1,54 @@
/* vietnamese */
@font-face {
font-display: swap;
font-family: 'Inconsolata';
font-style: normal;
font-weight: 400;
src: local('Inconsolata Regular'), local('Inconsolata-Regular'), url(https://fonts.gstatic.com/s/inconsolata/v17/QldKNThLqRwH-OJ1UHjlKGlW5qhExfHwNJU.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-display: swap;
font-family: 'Inconsolata';
font-style: normal;
font-weight: 400;
src: local('Inconsolata Regular'), local('Inconsolata-Regular'), url(https://fonts.gstatic.com/s/inconsolata/v17/QldKNThLqRwH-OJ1UHjlKGlX5qhExfHwNJU.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-display: swap;
font-family: 'Inconsolata';
font-style: normal;
font-weight: 400;
src: local('Inconsolata Regular'), local('Inconsolata-Regular'), url(https://fonts.gstatic.com/s/inconsolata/v17/QldKNThLqRwH-OJ1UHjlKGlZ5qhExfHw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
font-display: swap;
font-family: 'Inconsolata';
font-style: normal;
font-weight: 700;
src: local('Inconsolata Bold'), local('Inconsolata-Bold'), url(https://fonts.gstatic.com/s/inconsolata/v17/QldXNThLqRwH-OJ1UHjlKGHiw71m5_zaDpwm80E.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-display: swap;
font-family: 'Inconsolata';
font-style: normal;
font-weight: 700;
src: local('Inconsolata Bold'), local('Inconsolata-Bold'), url(https://fonts.gstatic.com/s/inconsolata/v17/QldXNThLqRwH-OJ1UHjlKGHiw71n5_zaDpwm80E.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-display: swap;
font-family: 'Inconsolata';
font-style: normal;
font-weight: 700;
src: local('Inconsolata Bold'), local('Inconsolata-Bold'), url(https://fonts.gstatic.com/s/inconsolata/v17/QldXNThLqRwH-OJ1UHjlKGHiw71p5_zaDpwm.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
Oops, something went wrong.

0 comments on commit 81b95d1

Please sign in to comment.
You can’t perform that action at this time.