Skip to content

Commit

Permalink
removed idoc.js call when drafting a "new"-created file.
Browse files Browse the repository at this point in the history
  • Loading branch information
espadrine committed Apr 11, 2010
1 parent 7d05ad7 commit 640717d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion idoc.js
Expand Up @@ -10,6 +10,7 @@ else if(document.location.protocol == 'file:')
name = document.URL.substring(8);

// 1. You have to learn to listen!
if(chrome.extension)
chrome.extension.onRequest.addListener(
function( request, sender, sendResponse ) {
if(request.edit == true) {
Expand Down Expand Up @@ -49,7 +50,8 @@ chrome.extension.onRequest.addListener(
else if(request.edit == 'draft') {
haveSaved = true;
sendResponse({ok:true, save:name,
content: document.getElementsByTagName('html')[0].innerHTML});
content: document.getElementsByTagName('html')[0].innerHTML
.replace(/idoc\.js/,'')}); // avoids infinite loop
}
else if(request.edit == "do") {
if (request.action == "createlink") {
Expand Down

0 comments on commit 640717d

Please sign in to comment.