Skip to content

Commit 980125b

Browse files
committed
minor code review
1 parent 6ea3338 commit 980125b

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

platform/chromium/vapi-background.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,8 @@ vAPI.tabs.open = function(details) {
375375
// "Note that fragment identifiers are not matched."
376376
// It's a lie, fragment identifiers ARE matched. So we need to remove the
377377
// fragment.
378-
var targetURLWithoutHash = targetURL;
379378
var pos = targetURL.indexOf('#');
380-
if ( pos !== -1 ) {
381-
targetURLWithoutHash = targetURL.slice(0, pos);
382-
}
379+
var targetURLWithoutHash = pos === -1 ? targetURL : targetURL.slice(0, pos);
383380

384381
chrome.tabs.query({ url: targetURLWithoutHash }, function(tabs) {
385382
var tab = tabs[0];

src/js/contentscript-end.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,9 @@ var uBlockCollapser = (function() {
470470
if ( shadow !== null && shadow.className === sessionId ) {
471471
continue;
472472
}
473-
// https://github.com/w3c/webcomponents/issues/102
474-
// not all nodes can be shadowed
473+
// https://github.com/gorhill/uBlock/pull/555
474+
// Not all nodes can be shadowed:
475+
// https://github.com/w3c/webcomponents/issues/102
475476
try {
476477
shadow = elem.createShadowRoot();
477478
shadow.className = sessionId;

src/js/contentscript-start.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@ var hideElements = function(selectors) {
181181
if ( shadow !== null && shadow.className === sessionId ) {
182182
continue;
183183
}
184-
// https://github.com/w3c/webcomponents/issues/102
185-
// not all nodes can be shadowed
184+
// https://github.com/gorhill/uBlock/pull/555
185+
// Not all nodes can be shadowed:
186+
// https://github.com/w3c/webcomponents/issues/102
186187
try {
187188
shadow = elem.createShadowRoot();
188189
shadow.className = sessionId;

0 commit comments

Comments
 (0)