Source file

Rice source file of the Cooker

Cooker is an application for manipulating web pages. Page manipuration is performed by the script written in Rice.

Please refer to the following link for requirements that the Rice source file should have.

In the following sections, it explains the special requirements that Rice source files of the Cooker should have.

.cook extension

The source file called directly from the cooker must have a .cook extension. The Rice source files with an extension other than .cook extension cannot be called from the Cooker.

However, a Rice source file with an extension other than .cook extension can import into a Rice source file with a .cook extension.

main class

The main class needs to be defined only once in the reading of the Rice source file starting from the .cook file.

The main class does not need to be defined in the .cook file. However, we recommend that you define it in a .cook file.

start() method

In the main class, you have to define a method that is the entry point of execution. The following methods are the entry points.

open method void start(browser)

open method void start()

The entry point will be described later.

end() method

In the main class, you can define a method that is the exit point of execution. The following methods are the exit points.

open method void end(browser)

open method void end()

Defining the exit point is optional.

The exit point will be described later.

JavaScript source file

Cooker can execute JavaScript directly. It is an execution that does not go through Rice.

.js extension

JavaScript source files that are executed directly must have a .js extension.

Conversion instruction

Cooker's JavaScript provides extensions. A special string for authentication is required to use the extension. This authentication string is given at the same time as conversion to Immediately Invoked Function Expression.

In direct execution, conversion is performed by writing the instruction directly in JavaScript. "///immed" and "///async" are conversion instructions. If the beginning of JavaScript is these strings, it will be converted to IIFE.

1:

alert(token);

Add "///immed" to the above JavaScript code.

1:

///immed

2:

alert(token);

Conversion is as follows. The 1st and 4th lines are added.

1:

(function(token){

2:

///immed

3:

alert(token);

4:

}("0f8fbd59d9cb769fa16570867728950e"));

Add "///async" to the above JavaScript code.

1:

///async

2:

alert(token);

Conversion is as follows. The 1st and 4th lines are added.

1:

(async function(token){

2:

///async

3:

alert(token);

4:

}("0f8fbd59d9cb769fa16570867728950e"));

Copyright © Cooker All rights reserved.