Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
98d041b4
Commit
98d041b4
authored
Oct 26, 2021
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak comments in response to PR review feedback
parent
e324109c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
boot.js
src/boot/boot.js
+2
-2
boot-test.js
src/boot/test/boot-test.js
+1
-1
No files found.
src/boot/boot.js
View file @
98d041b4
...
@@ -68,6 +68,8 @@ function injectScript(doc, src, forceReload = false) {
...
@@ -68,6 +68,8 @@ function injectScript(doc, src, forceReload = false) {
// Module scripts are only evaluated once per URL in a document. Adding
// Module scripts are only evaluated once per URL in a document. Adding
// a dynamic fragment forces re-evaluation without breaking browser or CDN
// a dynamic fragment forces re-evaluation without breaking browser or CDN
// caching of the script, as a query string would do.
// caching of the script, as a query string would do.
//
// See examples in https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-module-system
src
+=
`#ts=
${
Date
.
now
()}
`
;
src
+=
`#ts=
${
Date
.
now
()}
`
;
}
}
...
@@ -193,8 +195,6 @@ export function bootHypothesisClient(doc, config) {
...
@@ -193,8 +195,6 @@ export function bootHypothesisClient(doc, config) {
// Force re-evaluation of JS module scripts, so that the annotator entry
// Force re-evaluation of JS module scripts, so that the annotator entry
// point code gets re-run if the client is unloaded and later re-loaded.
// point code gets re-run if the client is unloaded and later re-loaded.
// We do this even if the client has not been loaded before because it is
// simpler and there are no negative effects (eg. to caching).
{
forceModuleReload
:
true
}
{
forceModuleReload
:
true
}
);
);
}
}
...
...
src/boot/test/boot-test.js
View file @
98d041b4
...
@@ -98,7 +98,7 @@ describe('bootstrap', () => {
...
@@ -98,7 +98,7 @@ describe('bootstrap', () => {
});
});
it
(
'loads assets for the annotation layer'
,
()
=>
{
it
(
'loads assets for the annotation layer'
,
()
=>
{
clock
.
tick
(
123
);
clock
.
tick
(
123
);
// Set timestamp used by module cache-busting fragment.
runBoot
(
'annotator'
);
runBoot
(
'annotator'
);
const
expectedAssets
=
[
const
expectedAssets
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment