File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11export default async function ( ) {
2+ if ( document . querySelector ( ".ste-bl-together-bg" ) ) return ;
23 let alertedBefore = await ScratchTools . storage . get ( "steBlAlert" ) ;
34 await ScratchTools . storage . set ( { key : "steBlAlert" , value : false } ) ;
45 await ScratchTools . waitForElement ( "script.blocklive-ext" ) ;
Original file line number Diff line number Diff line change @@ -77,19 +77,6 @@ class Feature {
7777 }
7878 }
7979 }
80- this . getSettings = function ( key ) {
81- var settings = { } ;
82- this . data . options ?. forEach ( function ( el ) {
83- if ( ScratchTools . Storage [ el . id ] ) {
84- settings [ el . id ] = ScratchTools . Storage [ el . id ] ;
85- }
86- } ) ;
87- if ( key ) {
88- return settings [ key ] ;
89- } else {
90- return settings ;
91- }
92- } ;
9380 this . tab = {
9481 path : window . location . pathname ,
9582 scratch : document . querySelector ( "#app" ) ? 3 : 2 ,
Original file line number Diff line number Diff line change 1+ export default function ( ) {
2+ let auth = {
3+ fetch : async function ( ) {
4+ let data = await (
5+ await fetch ( "https://scratch.mit.edu/session/" , {
6+ headers : {
7+ "x-requested-with" : "XMLHttpRequest" ,
8+ } ,
9+ } )
10+ ) . json ( ) ;
11+ return data ;
12+ } ,
13+ csrf : function ( ) {
14+ return ScratchTools . cookies . get ( "scratchcsrftoken" )
15+ } ,
16+ cookies : ScratchTools . cookies ,
17+ } ;
18+ return auth
19+ }
Original file line number Diff line number Diff line change 11import { default as self } from "./self.js" ;
22import { default as traps } from "./traps.js" ;
3+ import { default as auth } from "./auth.js" ;
34
45export default function ( data ) {
56 var feature = new Feature ( data ) ;
67 feature . self = self ( data . id ) ;
78 feature . traps = traps ( )
9+ feature . auth = auth ( )
810 return feature ;
911}
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ export default function (id) {
44 id,
55 data : feature ,
66 enabled : true ,
7+ waitForElement : ScratchTools . waitForElement ,
8+ waitForElements : ScratchTools . waitForElements ,
79 hideOnDisable : function ( element ) {
810 ScratchTools . managedElements . push ( {
911 element,
You can’t perform that action at this time.
0 commit comments