repo.or.cz
/
chromium-blink-merge.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git]
/
chrome
/
test
/
data
/
third_party
/
spaceport
/
js
/
util
/
cacheBust.js
blob
b5e1a1f55daa72b9befde3e649c650b38f3e8dc4
1
define
([ ],
function
() {
2
var
cacheBust
= {
3
buster
:
function
buster
() {
4
return
String
(
Math
.
random
()).
replace
(
/[^0-9]/g
,
''
);
5
},
6
7
url
:
function
cacheBustUrl
(
url
) {
8
if
(
/\?/
.
test
(
url
)) {
9
return
url
+
'&'
+
cacheBust
.
buster
();
10
}
else
{
11
return
url
+
'?'
+
cacheBust
.
buster
();
12
}
13
}
14
};
15
16
return
cacheBust
;
17
});