mirror of https://github.com/gorhill/uBlock.git
minor code review
This commit is contained in:
parent
95899a0d1d
commit
a42513aa2f
|
@ -1,3 +1,3 @@
|
|||
## uBlock Origin pages
|
||||
|
||||
HTML: <http://gorhill.github.io/uBlock/>.
|
||||
HTML: <https://gorhill.github.io/uBlock/>.
|
|
@ -477,11 +477,12 @@ const hnTrieManager = {
|
|||
// location, and consequently so will be the related WASM file.
|
||||
let workingDir;
|
||||
{
|
||||
const url = document.currentScript.src;
|
||||
const match = /[^\/]+$/.exec(url);
|
||||
workingDir = match !== null
|
||||
? url.slice(0, match.index)
|
||||
: '';
|
||||
const url = new URL(document.currentScript.src);
|
||||
const match = /[^\/]+$/.exec(url.pathname);
|
||||
if ( match !== null ) {
|
||||
url.pathname = url.pathname.slice(0, match.index);
|
||||
}
|
||||
workingDir = url.href;
|
||||
}
|
||||
|
||||
const memory = new WebAssembly.Memory({ initial: 1 });
|
||||
|
|
Loading…
Reference in New Issue