vendredi 3 mars 2017

Match Patterns similar host permission/content scripts - need codes in Typescript/Javascript

I writing my own chrome extension. I have a section in which the code execution is based on the current Url. There is a configuration key is an array of possible "permissions" similar to how host permission/content scripts "match" pattern works manifest.json. I need codes to determine which array configuration to chose based on the current Url.

e.g.: 1 current Url: localhost/

array 0: "permission": ["http:///","https:///"] array 1: "permission": ["http://localhost/*,"https://localhost"]

Both array 0,1 are valid but array 1 is the correct value.

e.g.:2

current Url: http://ift.tt/2lDy6sw

array 2: "permission": ["http://.abc.com/","https://.abc.com/"] array 3: "permission": ["http:///","https:///"]

both array 2,3 are valid but array 2 be the correct value

Chrome Match Patterns: http://ift.tt/1fi0nLu

Aucun commentaire:

Enregistrer un commentaire