# Level Editor - Level becomes unloadable - is there a way to get back in?

**URL:** <https://discourse.codecombat.com/t/level-editor-level-becomes-unloadable-is-there-a-way-to-get-back-in/8995>\
**Category:** Artisan\
**Created:** [September 19, 2016, 12:22am UTC](https://discourse.codecombat.com/t/level-editor-level-becomes-unloadable-is-there-a-way-to-get-back-in/8995 "2016-09-19T00:22:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harry\_the\_Wanderer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/harry_the_wanderer/32/5369_2.png) [@Harry\_the\_Wanderer](https://discourse.codecombat.com/u/Harry_the_Wanderer)\
**Post date:** [September 19, 2016, 12:22am UTC](https://discourse.codecombat.com/t/level-editor-level-becomes-unloadable-is-there-a-way-to-get-back-in/8995/1 "2016-09-19T00:22:04Z")

</div>

Adding Referee scripts to the level I some how got into a situation where I can no longer enter into the editor for my level.

Is there a way to get access back to this level? Or is my level and work now lost?

![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/4/40b7066d2c415bac69a94eb7d703f41c309a8ce1.png)

This is for a level where only local saves have been done. No publish to server yet.

Some of the log from App.js

 ![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/0/0ff912c1ad1cc906c31e39b0da8946c3271a84a6.png)

---

<div class="post-metadata">

**Author:** ![trotod](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/trotod/32/3263_2.png) [@trotod](https://discourse.codecombat.com/u/trotod)\
**Post date:** [September 19, 2016, 2:15am UTC](https://discourse.codecombat.com/t/level-editor-level-becomes-unloadable-is-there-a-way-to-get-back-in/8995/2 "2016-09-19T02:15:14Z")

</div>

You could try this script, if you messed up your referee extraCode:

> <https://gist.github.com/Catsync/4067ce1b69bb1dfb86d2>

---

<div class="post-metadata">

**Author:** ![Harry\_the\_Wanderer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/harry_the_wanderer/32/5369_2.png) [@Harry\_the\_Wanderer](https://discourse.codecombat.com/u/Harry_the_Wanderer)\
**Post date:** [September 19, 2016, 3:19am UTC](https://discourse.codecombat.com/t/level-editor-level-becomes-unloadable-is-there-a-way-to-get-back-in/8995/3 "2016-09-19T03:19:30Z")

</div>

!

Thank you @trotod I now have access again to my level.

For anyone who is using Safari you can try the following solution.

.1. Right click on the “Loading…” text and click **Inspect Element**  
.2. Look at the HTML page structure and search out where the `<div>` tags end that display the loading text and graphic loading bar  
.3. Inject the following HTML into the page so that you create a button on the web page.

`<button onclick="var t = currentView.level.get('thangs');var r = null;for(var i=0; i < t.length; i++) {var h = t[i];if(h.components) {for(var j=0; j < h.components.length; j++) {var c = h.components[j];if(c.config && c.config.extraCode) {r = h;var e = c.config.extraCode;c.config.extraCode = e + '\n{}';console.log('Found referee, commenting out extraCode');currentView.level.set('thangs',t);break;}}}if(r !== null) {break;}}if(r === null) {console.log('Referee not found.');}">Click to Fix the referee Code</button><p>Then refresh the browser page</p>`

.3.a. Do this by right clicking on a div tag in the **Elements** tab of Safari and choose **Edit as HTML**  
.3.b. Append the above code after the `</div>` tag so it goes between divs and shows on the page  
.4. Click the button to execute the code that was discussed by @trotod  
.5. There shouldn’t be any on screen visible errors (maybe in the console?)  
.6. Click the browsers refresh button

!! You should now have access to a level that was unable to load before due to the error using the Safari browser!

This solution basically takes the Safari / Firefox browsers ability to live edit code in the browser and injects a HTML button that “onclick” runs the code posted for the fix.

enjoy!

-HW

@trotod you have saved me 2 hours or rewrite!
