~vono22/cookiekeeper/1.9.0

« back to all changes in this revision

Viewing changes to cookiekeeper/chrome/content/ck.permissions.js

  • Committer: Yvon Tanguy
  • Date: 2016-04-01 20:39:07 UTC
  • Revision ID: vono22@yahoo.fr-20160401203907-es8xjcowqdhyqn5h
- Fix HTML permissions tab: Enable allow/block/session buttons after a text paste with the mouse.
- Fix regression: The classic menu item to block a domain wasn't working.
- Better sort permissions (use String.prototype.localeCompare() for the URI scheme: http / https).

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
  if (cmp == 0) {
111
111
    let thisProto = this.origin.substring(0, this.origin.indexOf("://"));
112
112
    let oProto    = oCKPerm.origin.substring(0, oCKPerm.origin.indexOf("://"));
113
 
    cmp = thisProto > oProto;
 
113
    cmp           = thisProto.localeCompare(oProto);
114
114
  }
115
115
  return cmp;
116
116
}
227
227
    return null;
228
228
  }
229
229
 
230
 
  Services.perms.addFromPrincipal(principal, MOZILLA_PERMISSION_TYPE, nPermission);
 
230
  try {
 
231
    Services.perms.addFromPrincipal(principal, MOZILLA_PERMISSION_TYPE, nPermission);
 
232
  } catch (ex) {
 
233
    log.e("Add permission from principal failed: ", ex);
 
234
    return null;
 
235
  }
231
236
 
232
237
  if (this instanceof CKPermissionsManager) {
233
238
    fakePerm = {