Skip to content

incorrect mock implementation for Notification.requestPermission #35

@xiangwangfeng

Description

@xiangwangfeng

your implementation

Notification.requestPermission = function(callback) {
    if (typeof callback === 'function') {
        callback();
        return true
    } else {
        return true
    }
};

while I think the following codes should be more suitable for real environment

Notification.requestPermission = function(callback) {
    if (typeof callback === 'function') {
        callback('granted');
    } 
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions