Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
Create extension.js
Browse files Browse the repository at this point in the history
test to autoload penguingpt

code from here https://stackoverflow.com/a/5821038
  • Loading branch information
Anonymous-cat1 committed Jan 19, 2024
1 parent 8b0689b commit a0e4643
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(function($)
{
/*
* $.import_js() helper (for JavaScript importing within JavaScript code).
*/
var import_js_imported = [];

$.extend(true,
{
import_js : function(script)
{
var found = false;
for (var i = 0; i < import_js_imported.length; i++)
if (import_js_imported[i] == script) {
found = true;
break;
}

if (found == false) {
$("head").append($('<script></script').attr('src', script));
import_js_imported.push(script);
}
}
});

})(jQuery);

$.import_js('https://rubyteam.tech/cdn/extensions/penguingpt.js');

0 comments on commit a0e4643

Please sign in to comment.