poush / H2

Supporting light weight extensions for heavy task lifting
MIT License
16 stars 32 forks source link

Can open any URL with baseMediaProvider, navigate between youtube videos #55

Closed jfstn closed 5 years ago

jfstn commented 5 years ago

Solves #52

poush commented 5 years ago

@jfstn I think you missed the original issue here. This is related to #9 and the PR of it. We currently blocks all external links and show an alert with instructions to open the url on any browser. Instead, we can open that url on the same window by preventing new window and calling providers (as when cmd/ctrl + shift + v) is pressed.

jfstn commented 5 years ago

Hello, I'll take care of it after work.

jfstn commented 5 years ago
       get getContent() {
        let link = clipboard.readText('selection')
        if(this.extractContents(link)){
            // console.log(this.response)
            return this
        }

        throw "InvalidContentByContentExtraction"
    }

Wouldn't it be better to change this getter to not rely on clipboard.readText('selection')?

Made a new commit. Check it out when you can.

poush commented 5 years ago

@jfstn Agree, the design of baseMediaProvider is not accurate right now. This getter should not depend upon clipboard, instead, must be provided with the link as an argument or object member.

jfstn commented 5 years ago

@poush getters can't be used with arguments. Instead a setter should be used. That's what I did, pushing at the moment.

poush commented 5 years ago

This pull request introduces 1 alert when merging b7235782572933561598a52da3ed42ea102f4ad1 into 54e54ec15eb8426d7170e1300925249b9bddc882 - view on LGTM.com

new alerts:


Comment posted by LGTM.com