Skip to content

Commit

Permalink
minor code review
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Aug 3, 2015
1 parent 6ea3338 commit 980125b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 1 addition & 4 deletions platform/chromium/vapi-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,8 @@ vAPI.tabs.open = function(details) {
// "Note that fragment identifiers are not matched."
// It's a lie, fragment identifiers ARE matched. So we need to remove the
// fragment.
var targetURLWithoutHash = targetURL;
var pos = targetURL.indexOf('#');
if ( pos !== -1 ) {
targetURLWithoutHash = targetURL.slice(0, pos);
}
var targetURLWithoutHash = pos === -1 ? targetURL : targetURL.slice(0, pos);

chrome.tabs.query({ url: targetURLWithoutHash }, function(tabs) {
var tab = tabs[0];
Expand Down
5 changes: 3 additions & 2 deletions src/js/contentscript-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,9 @@ var uBlockCollapser = (function() {
if ( shadow !== null && shadow.className === sessionId ) {
continue;
}
// https://github.com/w3c/webcomponents/issues/102
// not all nodes can be shadowed
// https://github.com/gorhill/uBlock/pull/555
// Not all nodes can be shadowed:
// https://github.com/w3c/webcomponents/issues/102
try {
shadow = elem.createShadowRoot();
shadow.className = sessionId;
Expand Down
5 changes: 3 additions & 2 deletions src/js/contentscript-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ var hideElements = function(selectors) {
if ( shadow !== null && shadow.className === sessionId ) {
continue;
}
// https://github.com/w3c/webcomponents/issues/102
// not all nodes can be shadowed
// https://github.com/gorhill/uBlock/pull/555
// Not all nodes can be shadowed:
// https://github.com/w3c/webcomponents/issues/102
try {
shadow = elem.createShadowRoot();
shadow.className = sessionId;
Expand Down

0 comments on commit 980125b

Please sign in to comment.