2016-03-01 31 views
0

我可以在我的瀏覽器控制檯中添加任何庫,如貓鼬(即使它是臨時的,並在刷新時完成)。所以我可以從瀏覽器控制檯訪問它的功能。任何插件也讚賞。如何將庫添加到瀏覽器控制檯?

回答

0

你可以添加腳本標籤中已經從瀏覽器控制檯通過

document.head.innerHTML+="<script src='https://raw.githubusercontent.com/Automattic/mongoose/master/bin/mongoose.js'></script>"; 

而對於更多的原生方式加載頁面,

var script = document.createElement('script'); 
script.type = 'text/javascript'; 
script.src = 'https://raw.githubusercontent.com/Automattic/mongoose/master/bin/mongoose.js'; // url of the mongoose.js 
document.head.appendChild(script); 

它將使用

可在控制檯
>> mongoose; 
<- Object { Error: MongooseError(), Schema: Schema(), Types: Object, VirtualType: VirtualType(), SchemaType: SchemaType(), utils: Object, Document: Document() } 
+0

創建的頁面實際上是REST客戶端應用程序。我想將這個庫包含到它的控制檯瀏覽器中。 – Mohit

+1

您正在使用哪個客戶端? @Mohit – gmuraleekrishna

+0

Mozilla REST客戶端插件 – Mohit