AnsweredAssumed Answered

Chrome extensions for Canvas: content_scripts:{[matches:[]]} problem

Question asked by Dan Baeckström on Nov 14, 2019
Latest reply on Nov 19, 2019 by Dan Baeckström

I want to create a Chrome extension to enhance the functionality of Canvas (see my comment in this Idea thread for context). But I think I have run into a problem I can't solve. A Chrome extension must include a manifest.json file which declares the basic premises for the operation of the extension. Among the declarations required there is the  content_scripts:{[matches:[]]} list, which specifies the set of pages that should be affected by the extension, based on their corresponding URLs. Wildcards (*) can be used here, but not in all parts of the address. Specifically, the top domain and its preceding neighbour must not be substituted by wildcards.

 

For instance, the address "https://*.inspera.no" is accepted, as is "https://canvas.gu.se/*" (the latter being my University's Canvas address). However, "https://canvas.*.*/*" is not accepted. 

 

Judging from my University's Canvas address, it seems that Canvas page addresses are based on the pattern "https://canvas.[institution domain name].[top domain name]". That would present a problem for me to create Canvas Chrome extensions that could be used by any Canvas page, since I would not be able to write a manifest.json file covering all those addresses in the content_scripts:{[matches:[]]} list.

 

Do you have any experience with Chrome extensions for Canvas, and specifically how to deal with this namespace issue?

Outcomes