Project

General

Profile

« Previous | Next » 

Revision f650ee99

Added by koszko over 1 year ago

prepare for exposing APIs to injected scripts

View differences:

content/content.js
42 42
 */
43 43

  
44 44
#IMPORT content/repo_query_cacher.js
45
#IMPORT content/haketilo_apis.js
45 46

  
46 47
#FROM common/browser.js           IMPORT browser
47 48
#FROM common/misc.js              IMPORT is_privileged_url
......
132 133
	    resolve_page_info(Object.assign(page_info, script_response));
133 134
	    return;
134 135
	} else {
135
	    for (const script_contents of script_response.files) {
136
	    haketilo_apis.start();
137

  
138
	    const version = browser.runtime.getManifest().version;
139
	    const scripts = [
140
		`window.haketilo_version = ${JSON.stringify(version)};`,
141
		...script_response.files
142
	    ];
143
	    for (const script_contents of scripts) {
136 144
		const html_ns = "http://www.w3.org/1999/xhtml";
137 145
		const script = document.createElementNS(html_ns, "script");
138 146

  

Also available in: Unified diff