Gandi-IDE / custom-extension

GNU Lesser General Public License v2.1
43 stars 62 forks source link

创建:Skydog-cookie #251

Open MoreBugOfDog opened 5 months ago

MoreBugOfDog commented 5 months ago

// Name: Skydog's Cookie // Version: 1.0.0 // ID: SkydogCookie // Description: Manipulate cookies! Set expiration time! // By: MoreBugOfDog // License: MPL-2.0 // 本拓展经过开发者严格的法律审查,不涉及任何违法行为。 // 使用本拓展造成的任何后果与开发者无关。 // Cookie的读取和储存强制添加了唯一标识符和命名空间(ccw_custom_作品链接_用户输入的name), // path强制为/ 防止随请求携带导致错误 // 编辑器内和编辑器外cookie不同步,这是为了方便肝酱开发,非Bug

与 白猫 数据助手 拓展的不同

白猫的拓展定死了要在作品里才能删,而我的Cookie是可以根据时间自动过期,无需开启作品,这适合做登录注册、现实道具等内容,更符合实际应用 如需永久储存,可设置时间为999999999 感谢CookieCloud给我的封面提供的灵感!

安全性

为保存的cookie设置了命名空间,并添加了作品的唯一标识符认证,确保不跨作品、跨网站读取。 path强制设为 / 防止网络请求携带用户cookie导致错误

方便开发

采用 编辑器 和 详情页 隔离的设计,方便肝酱测试、开发

积木预览

image

——————————————————————————————————————————————————————— // Name: Skydog's Cookie // Version: 1.0.0 // ID: SkydogCookie // Description: Manipulate cookies! Set expiration time! // By: MoreBugOfDog // License: MPL-2.0 // This extension has been examined by the developer and is not intended to violate any laws. // The developer is not responsible for any consequences of using this extension. // Unique identifiers and namespaces (ccw_custom_artwork_link_user_entered_name) are enforced for cookie reading and storage. // path is forced to be / to prevent carrying it with the request from causing errors // In-editor and out-of-editor cookies are not synchronized, this is for the convenience of Liver Sauce developers, not a bug.

Differences from WhiteCat's Data Helper extension

WhiteCat's extension can only be deleted in the work, while my cookie can automatically expire according to the time, without opening the work, which is suitable for login and registration, reality props, etc., and more in line with the actual application. For permanent storage, you can set the time to 9999999999. Thanks to CookieCloud for inspiring my cover!

Security

Namespaces are set for saved cookies, and unique identifier authentication of the artwork is added to ensure that they are not read across artworks and websites. path is forced to / to prevent web requests carrying user cookies from causing errors

Convenient for developers

The editor and detail page are isolated for easy testing and development.

xiaochen004hao commented 5 months ago

我喜欢😎

MoreBugOfDog commented 5 months ago

不好意思,commit有点乱

qxsck commented 5 months ago

你这commit是什么B动静

MoreBugOfDog commented 5 months ago

你这commit是什么B动静

不好意思哈,我上传的时候不小心按了个变基()

kukemc commented 5 months ago

有非得多的问题,从各种角度来看cookie都不适合应用在Scratch当中

  1. cookie可以很轻易的被修改&删除
  2. 同域名下cookie公用的是同一个存储空间 最多仅能存储4KB数据(也就是说所有作品共用的是同一个容量) 如果溢出网站大概率会直接炸
  3. 当网站请求时cookie信息会自动放到请求信息中 如果cookie过大会大幅度减缓网站整体访问速度